/* ==========================================================================
   Somiti Pro — main stylesheet
   Mobile-first app UI for cooperative societies.
   Motif: kantha running-stitch (dashed seams) on headers, dividers and cards.
   ========================================================================== */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: "Hind Siliguri"; src: url("../fonts/hind-siliguri-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("../fonts/hind-siliguri-medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("../fonts/hind-siliguri-semibold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("../fonts/hind-siliguri-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Tiro Bangla"; src: url("../fonts/tiro-bangla-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--sm-primary: #13843f;
	--sm-blue: #1f5fbf;
	--sm-purple: #5b3cc4;
	--sm-orange: #e8590c;
	--sm-navy: #15264b;
	--sm-red: #c62828;

	--sm-primary-600: color-mix(in srgb, var(--sm-primary) 78%, #000);
	--sm-primary-50: color-mix(in srgb, var(--sm-primary) 9%, #fff);

	--sm-bg: #f1f5f1;
	--sm-surface: #ffffff;
	--sm-ink: #16241c;
	--sm-ink-2: #3f4f46;
	--sm-muted: #67776e;
	--sm-line: #e1e8e2;
	--sm-line-strong: #cdd7cf;

	--sm-radius: 16px;
	--sm-shadow: 0 1px 2px rgba(18, 38, 26, .05), 0 6px 20px rgba(18, 38, 26, .05);
	--sm-font: "Hind Siliguri", "Noto Sans Bengali", "Siyam Rupali", system-ui, -apple-system, "Segoe UI", sans-serif;
	--sm-font-display: "Tiro Bangla", "Noto Serif Bengali", "Hind Siliguri", serif;
	--sm-nav-h: 68px;

	--tone: var(--sm-primary);
}

/* Each tone context re-derives its shades from its own --tone. */
:root,
.sm-content,
dialog.sm-sheet,
[class*="sm-tone-"] {
	--tone-600: color-mix(in srgb, var(--tone) 78%, #000);
	--tone-50: color-mix(in srgb, var(--tone) 10%, #fff);
}
.sm-tone-green  { --tone: var(--sm-primary); }
.sm-tone-blue   { --tone: var(--sm-blue); }
.sm-tone-purple { --tone: var(--sm-purple); }
.sm-tone-orange { --tone: var(--sm-orange); }
.sm-tone-navy   { --tone: var(--sm-navy); }
.sm-tone-red    { --tone: var(--sm-red); }

.sm-screen-loan .sm-content { --tone: var(--sm-purple); }
.sm-screen-wallet .sm-content { --tone: var(--sm-blue); }
.sm-screen-admin .sm-content,
.sm-screen-members .sm-content { --tone: var(--sm-navy); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.somiti-app {
	margin: 0;
	background: var(--sm-bg);
	color: var(--sm-ink);
	font: 400 15px/1.6 var(--sm-font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
}
body.somiti-app:has(dialog[open]) { overflow: hidden; }
a { color: var(--sm-primary); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--sm-primary) 65%, #fff); outline-offset: 2px; }
[hidden] { display: none !important; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
	overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.sm-skip {
	position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px;
	background: var(--sm-ink); color: #fff; text-decoration: none; font-weight: 600;
}
.sm-skip:focus { top: 12px; }

.sm-app { min-height: 100vh; min-height: 100dvh; }
.sm-main { min-width: 0; padding-bottom: calc(var(--sm-nav-h) + 20px + env(safe-area-inset-bottom)); }
.sm-main--plain { padding-bottom: 32px; }
.sm-screen-login .sm-main { padding-bottom: 0; }

/* ---------- Top app bar ---------- */
.sm-topbar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 30;
	background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 92%, #fff), var(--tone));
	color: #fff;
	padding-top: env(safe-area-inset-top);
}
.sm-topbar::after { /* running stitch seam */
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -5px;
	height: 2.5px;
	background: repeating-linear-gradient(90deg, var(--tone) 0 11px, transparent 11px 18px);
	opacity: .55;
}
.sm-topbar__inner {
	height: 58px;
	display: grid;
	grid-template-columns: 92px 1fr 92px;
	align-items: center;
	padding: 0 6px;
}
.sm-topbar__side { display: flex; align-items: center; gap: 2px; }
.sm-topbar__side--end { justify-content: flex-end; }
.sm-topbar__title {
	margin: 0;
	text-align: center;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.sm-iconbtn {
	position: relative;
	width: 42px; height: 42px;
	display: inline-grid; place-items: center;
	border: 0; border-radius: 12px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s;
}
.sm-iconbtn:hover { background: rgba(255, 255, 255, .15); }
.sm-iconbtn--plain { color: var(--sm-ink-2); }
.sm-iconbtn--plain:hover { background: var(--sm-bg); }
.sm-dot {
	position: absolute; top: 5px; right: 5px;
	min-width: 17px; height: 17px; padding: 0 4px;
	border-radius: 99px;
	background: #ffb020; color: #2b1a00;
	font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
	box-shadow: 0 0 0 2px var(--tone);
}

/* ---------- Content ---------- */
.sm-content {
	max-width: 640px;
	margin: 0 auto;
	padding: 18px 16px 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.sm-split, .sm-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.sm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sm-center { text-align: center; }
.sm-center .sm-btn { width: auto; }
.sm-muted { color: var(--sm-muted); font-size: 14px; margin: 0 0 12px; }

/* ---------- Cards ---------- */
.sm-card {
	background: var(--sm-surface);
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	padding: 16px;
	box-shadow: var(--sm-shadow);
	min-width: 0;
}
.sm-card__head {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
	margin-bottom: 6px;
}
.sm-card__head h2 { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.sm-card__head a { font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; color: var(--tone); }
.sm-subhead { display: flex; align-items: center; gap: 6px; margin: 18px 0 0; font-size: 14px; color: var(--sm-red); }

/* ---------- Profile ---------- */
.sm-profile {
	display: flex; align-items: center; gap: 14px;
	background: var(--sm-surface);
	border: 1px solid var(--sm-line);
	border-radius: var(--sm-radius);
	padding: 14px 16px;
	box-shadow: var(--sm-shadow);
}
.sm-profile__text { min-width: 0; }
.sm-profile__name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.sm-profile__id { margin: 2px 0 6px; font-size: 13px; color: var(--sm-muted); }
.sm-profile__admin { margin-left: auto; flex: none; }
.sm-profile--card { padding: 18px; }
.sm-avatar {
	flex: none;
	display: inline-grid; place-items: center;
	border-radius: 50%;
	overflow: hidden;
	background: var(--sm-primary-50);
	color: var(--sm-primary);
	box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px color-mix(in srgb, var(--sm-primary) 30%, #fff);
}
.sm-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Stat cards ---------- */
.sm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sm-stat {
	position: relative;
	overflow: hidden;
	display: flex; flex-direction: column; gap: 2px;
	min-height: 120px;
	padding: 14px;
	border-radius: 16px;
	background: linear-gradient(145deg, color-mix(in srgb, var(--tone) 90%, #fff), var(--tone-600));
	color: #fff;
	text-decoration: none;
	box-shadow: 0 10px 20px -14px var(--tone);
	transition: transform .15s, box-shadow .15s;
}
a.sm-stat:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px var(--tone); }
.sm-stat::after {
	content: "";
	position: absolute; right: -34px; bottom: -44px;
	width: 116px; height: 116px;
	border-radius: 50%;
	border: 1.5px dashed rgba(255, 255, 255, .28);
	box-shadow: inset 0 0 0 14px rgba(255, 255, 255, .06);
}
.sm-stat__icon {
	position: absolute; top: 12px; right: 12px;
	width: 38px; height: 38px;
	border-radius: 12px;
	display: grid; place-items: center;
	background: rgba(255, 255, 255, .16);
}
.sm-stat__label { font-size: 13px; opacity: .92; padding-right: 44px; }
.sm-stat__value { margin-top: auto; font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.sm-stat__more { display: inline-flex; align-items: center; gap: 2px; margin-top: 4px; font-size: 12px; opacity: .88; }

/* ---------- Hero summary ---------- */
.sm-hero {
	position: relative;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 20px;
	border-radius: 18px;
	background: var(--sm-surface);
	border: 1px solid var(--sm-line);
	box-shadow: var(--sm-shadow);
	outline: 1.5px dashed color-mix(in srgb, var(--tone) 28%, transparent);
	outline-offset: -8px;
}
.sm-hero__label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--sm-muted); }
.sm-hero__value { margin: 2px 0 0; font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--tone); font-variant-numeric: tabular-nums; }
.sm-hero__meta { margin: 6px 0 0; font-size: 12.5px; color: var(--sm-muted); }
.sm-hero__icon {
	flex: none;
	width: 60px; height: 60px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--tone);
	color: #fff;
	box-shadow: 0 0 0 7px var(--tone-50);
}
.sm-hero--filled {
	background: linear-gradient(135deg, color-mix(in srgb, var(--tone) 88%, #fff), var(--tone-600));
	border-color: transparent;
	color: #fff;
	outline-color: rgba(255, 255, 255, .3);
}
.sm-hero--filled .sm-hero__label,
.sm-hero--filled .sm-hero__meta { color: rgba(255, 255, 255, .85); }
.sm-hero--filled .sm-hero__value { color: #fff; }
.sm-hero--filled .sm-hero__icon { background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 7px rgba(255, 255, 255, .08); }

/* ---------- Lists & rows ---------- */
.sm-list { list-style: none; margin: 0; padding: 0; }
.sm-row {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 0;
	border-bottom: 1px dashed var(--sm-line-strong);
}
.sm-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.sm-row__icon {
	flex: none;
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border-radius: 12px;
	background: var(--tone-50);
	color: var(--tone);
}
.sm-row__icon[style] { background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); }
.sm-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-row__title { font-size: 14.5px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-row__sub { font-size: 12.5px; color: var(--sm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-row__end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.sm-row--plain .sm-row__title { font-weight: 600; }

.sm-amt { font-size: 15px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sm-amt--green { color: var(--sm-primary); }
.sm-amt--red { color: var(--sm-red); }
.sm-amt--purple { color: var(--sm-purple); }
.sm-amt--blue { color: var(--sm-blue); }
.sm-amt--orange { color: var(--sm-orange); }
.sm-amt--muted { color: var(--sm-muted); }

/* ---------- Badges ---------- */
.sm-badge {
	display: inline-flex; align-items: center;
	height: 22px; padding: 0 9px;
	border-radius: 99px;
	font-size: 12px; font-weight: 600; line-height: 1;
	white-space: nowrap;
	background: #eef1ef; color: var(--sm-ink-2);
}
.sm-badge--approved, .sm-badge--paid, .sm-badge--active, .sm-badge--member { background: var(--sm-primary-50); color: var(--sm-primary-600); }
.sm-badge--pending { background: #fff3d1; color: #835600; }
.sm-badge--running { background: #ffe7d6; color: #a83f00; }
.sm-badge--rejected, .sm-badge--locked { background: #fde8e8; color: #a82018; }
.sm-badge--inactive { background: #eceff1; color: #4f6470; }

/* ---------- Buttons ---------- */
.sm-btn {
	--b: var(--tone, var(--sm-primary));
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%;
	min-height: 50px;
	padding: 0 20px;
	border: 0;
	border-radius: 14px;
	background: linear-gradient(180deg, color-mix(in srgb, var(--b) 90%, #fff), var(--b));
	color: #fff;
	font-size: 15.5px; font-weight: 600; line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 8px 16px -10px var(--b), inset 0 -2px 0 rgba(0, 0, 0, .1);
	transition: transform .12s, filter .15s, box-shadow .15s;
}
.sm-btn:hover { filter: brightness(1.06); color: #fff; }
.sm-btn:active { transform: translateY(1px); }
.sm-btn--sm { width: auto; min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; gap: 6px; }
.sm-btn--outline { background: #fff; color: var(--b); box-shadow: inset 0 0 0 1.5px var(--b); }
.sm-btn--outline:hover { color: var(--b); background: color-mix(in srgb, var(--b) 6%, #fff); filter: none; }
.sm-btn--ghost { background: color-mix(in srgb, var(--b) 10%, #fff); color: var(--tone-600, var(--b)); box-shadow: none; }
.sm-btn--ghost:hover { color: var(--b); filter: none; background: color-mix(in srgb, var(--b) 16%, #fff); }
.sm-btn--danger-ghost { --b: var(--sm-red); background: #fdecec; color: var(--sm-red); box-shadow: none; }
.sm-btn--danger-ghost:hover { color: #fff; background: var(--sm-red); filter: none; }
.sm-btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sm-btnrow .sm-btn { min-height: 46px; font-size: 14px; padding: 0 10px; }
.sm-link { background: none; border: 0; padding: 0; color: var(--sm-primary); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.sm-link:hover { text-decoration: underline; }
.sm-inline { display: inline; margin: 0; }

.sm-sticky-cta {
	position: sticky;
	bottom: calc(var(--sm-nav-h) + 10px + env(safe-area-inset-bottom));
	z-index: 20;
}

/* ---------- Tiles ---------- */
.sm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sm-tiles--4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sm-tile {
	--c: var(--sm-primary);
	position: relative;
	display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px;
	padding: 12px 6px;
	border: 1px solid var(--sm-line);
	border-radius: 14px;
	background: #fff;
	color: var(--sm-ink);
	font-size: 12.5px; font-weight: 500; line-height: 1.3; text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s, border-color .15s, box-shadow .15s;
}
.sm-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, #fff); box-shadow: 0 8px 18px -12px var(--c); color: var(--sm-ink); }
.sm-tile__ico {
	width: 46px; height: 46px;
	display: grid; place-items: center;
	border-radius: 14px;
	background: color-mix(in srgb, var(--c) 12%, #fff);
	color: var(--c);
}
.sm-tiles--4 .sm-tile { padding: 10px 4px; font-size: 12px; }
.sm-tiles--4 .sm-tile__ico { width: 42px; height: 42px; }
.sm-tile__badge {
	position: absolute; top: 6px; right: 8px;
	min-width: 20px; height: 20px; padding: 0 5px;
	display: grid; place-items: center;
	border-radius: 99px;
	background: var(--sm-red); color: #fff;
	font-size: 11px; font-weight: 700;
}

/* ---------- Chips & filters ---------- */
.sm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px -16px; padding: 4px 16px; }
.sm-chips::-webkit-scrollbar { display: none; }
.sm-chips:not(:has(.sm-chip)) { display: none; }
.sm-chip {
	flex: none;
	display: flex; flex-direction: column;
	padding: 8px 12px;
	border: 1px solid var(--sm-line);
	border-radius: 12px;
	background: var(--sm-surface);
	color: var(--sm-muted);
	font-size: 12px; line-height: 1.35;
	text-decoration: none;
}
.sm-chip strong { color: var(--sm-ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.sm-chip.is-active { border-color: var(--tone); background: var(--tone-50); }
.sm-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.sm-filter__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.sm-filter--inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- Forms ---------- */
.sm-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.sm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sm-field > label { font-size: 13.5px; font-weight: 600; color: var(--sm-ink-2); }
.sm-input {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1.5px solid var(--sm-line-strong);
	border-radius: 12px;
	background: #fff;
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.sm-input::placeholder { color: #9aa79f; }
.sm-input:focus { outline: 0; border-color: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 16%, transparent); }
select.sm-input {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2367776e' stroke-width='2' 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;
}
input[type="date"].sm-input { min-height: 48px; }
.sm-input--area { height: auto; min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.sm-input--file { height: auto; padding: 10px; font-size: 14px; }
.sm-amount { position: relative; }
.sm-amount > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--sm-muted); font-size: 17px; pointer-events: none; }
.sm-amount .sm-input { padding-left: 36px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sm-pass { position: relative; }
.sm-pass .sm-input { padding-right: 50px; }
.sm-pass__toggle {
	position: absolute; right: 4px; top: 4px;
	width: 40px; height: 40px;
	display: grid; place-items: center;
	border: 0; border-radius: 10px;
	background: transparent;
	color: var(--sm-muted);
	cursor: pointer;
}
.sm-pass__toggle .is-hide, .sm-pass.is-visible .is-show { display: none; }
.sm-pass.is-visible .is-hide { display: block; }
.sm-help { margin: 0; font-size: 12.5px; color: var(--sm-muted); }
.sm-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; color: var(--sm-ink-2); }
.sm-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--sm-primary); }

.sm-note {
	display: flex; gap: 10px; align-items: flex-start;
	margin-bottom: 14px;
	padding: 12px 14px;
	border: 1px solid #f2dda4;
	border-radius: 12px;
	background: #fff8e5;
	color: #5f4300;
	font-size: 13.5px; line-height: 1.55;
}
.sm-note > svg { flex: none; margin-top: 2px; color: #b07800; }
.sm-estimate { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--tone-50); }
.sm-estimate span { font-size: 13px; color: var(--sm-ink-2); }
.sm-estimate strong { font-size: 21px; color: var(--tone); font-variant-numeric: tabular-nums; }
.sm-estimate small { font-size: 12px; color: var(--sm-muted); }

/* ---------- Flash ---------- */
.sm-flash {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 12px 10px 12px 14px;
	border-radius: 14px;
	font-size: 14px; font-weight: 500; line-height: 1.5;
	animation: sm-fade .3s ease;
}
.sm-flash > svg { flex: none; margin-top: 1px; }
.sm-flash > span { flex: 1; }
.sm-flash--success { background: #e6f5eb; border: 1px solid #bfe3ca; color: #0d5528; }
.sm-flash--error { background: #fdecec; border: 1px solid #f4c4c0; color: #8a1c16; }
.sm-flash__x { flex: none; padding: 2px; border: 0; border-radius: 6px; background: none; color: inherit; opacity: .6; cursor: pointer; }
.sm-flash.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }

/* ---------- Empty ---------- */
.sm-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 10px; color: var(--sm-muted); text-align: center; }
.sm-empty > svg { opacity: .45; }
.sm-empty p { margin: 0; font-size: 14px; }

/* ---------- Tabs ---------- */
.sm-tabs__bar {
	display: grid; grid-template-columns: 1fr 1fr;
	margin-bottom: 14px;
	padding: 4px;
	border: 1px solid var(--sm-line);
	border-radius: 14px;
	background: var(--sm-surface);
}
.sm-tabs__bar button {
	height: 42px;
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: 0; border-radius: 10px;
	background: transparent;
	color: var(--sm-muted);
	font-size: 14px; font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.sm-tabs__bar button.is-active { background: var(--tone-50); color: var(--tone); }
.sm-count { min-width: 20px; padding: 0 6px; border-radius: 99px; background: rgba(0, 0, 0, .06); font-size: 11.5px; line-height: 19px; }

/* ---------- Loans ---------- */
.sm-grid-cards { display: grid; gap: 14px; }
.sm-loan__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sm-loan__head h3 { margin: 0; font-size: 16px; }
.sm-progress { height: 8px; overflow: hidden; border-radius: 99px; background: var(--tone-50); }
.sm-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 65%, #fff)); }
.sm-progress__label { margin: 6px 0 2px; font-size: 12px; color: var(--sm-muted); text-align: right; }
.sm-loan__purpose { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--sm-bg); font-size: 13px; color: var(--sm-muted); }

.sm-dl { margin: 0 0 12px; }
.sm-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--sm-line-strong); font-size: 14px; }
.sm-dl dt { color: var(--sm-muted); }
.sm-dl dd { margin: 0; font-weight: 600; text-align: right; word-break: break-word; }
.sm-dl > .sm-dl__total { border-bottom: 0; padding-top: 12px; }
.sm-dl__total dt { color: var(--sm-ink); font-weight: 600; }
.sm-dl__total dd { font-size: 17px; color: var(--tone); }
.sm-loan .sm-dl { margin-bottom: 0; }

/* ---------- Bottom sheet ---------- */
dialog.sm-sheet {
	width: 100%;
	max-width: 560px;
	max-height: 92vh;
	max-height: 92dvh;
	margin: auto auto 0;
	padding: 0;
	border: 0;
	border-radius: 24px 24px 0 0;
	background: var(--sm-surface);
	color: var(--sm-ink);
	box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
	overflow: auto;
	overscroll-behavior: contain;
}
dialog.sm-sheet::backdrop { background: rgba(10, 24, 16, .5); backdrop-filter: blur(2px); }
dialog.sm-sheet[open] { animation: sm-sheet-up .32s cubic-bezier(.2, .9, .25, 1); }
.sm-sheet__grab { width: 44px; height: 5px; margin: 10px auto 0; border-radius: 99px; background: var(--sm-line-strong); }
.sm-sheet__head {
	position: sticky; top: 0; z-index: 2;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 8px 12px 6px 20px;
	background: var(--sm-surface);
}
.sm-sheet__head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sm-sheet__body { padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); }

/* ---------- Notices ---------- */
.sm-notices { list-style: none; margin: 0; padding: 0; }
.sm-notices > li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--sm-line-strong); }
.sm-notices > li:last-child { border-bottom: 0; }
.sm-notices__icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #fff3d1; color: #a66a00; }
.sm-notices strong { display: block; font-size: 14.5px; line-height: 1.4; }
.sm-notices small { display: block; margin-top: 1px; font-size: 12px; color: var(--sm-muted); }
.sm-notices p, .sm-notices__body { margin: 6px 0 0; font-size: 13.5px; color: var(--sm-ink-2); }
.sm-notices__body p { margin: 0 0 6px; }

/* ---------- Committee ---------- */
.sm-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sm-person { display: flex; align-items: center; gap: 14px; padding: 14px; }
.sm-person__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.sm-person__text strong { font-size: 15.5px; }
.sm-person__role { font-size: 13px; font-weight: 600; color: var(--sm-primary); }
.sm-person__phone { font-size: 13px; color: var(--sm-muted); font-variant-numeric: tabular-nums; }
.sm-call {
	flex: none;
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: var(--sm-primary-50);
	color: var(--sm-primary);
	transition: background .15s, color .15s;
}
.sm-call:hover { background: var(--sm-primary); color: #fff; }

/* ---------- Rules ---------- */
.sm-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sm-rule { border-left: 4px solid var(--sm-primary); }
.sm-rule h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 15.5px; color: var(--sm-primary-600); line-height: 1.4; }
.sm-rule__num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--sm-primary-50); color: var(--sm-primary); font-size: 14px; font-weight: 700; }
.sm-rule__body { font-size: 14px; color: var(--sm-ink-2); }
.sm-rule__body p { margin: 0 0 8px; }
.sm-rule__body p:last-child { margin: 0; }
.sm-print-head { display: none; }

/* ---------- Report ---------- */
.sm-mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sm-mini {
	padding: 12px 14px;
	border: 1px solid var(--sm-line);
	border-top: 3px solid var(--tone);
	border-radius: 14px;
	background: var(--sm-surface);
	min-width: 0;
}
.sm-mini:last-child:nth-child(odd) { grid-column: 1 / -1; }
.sm-mini span { display: block; font-size: 12.5px; color: var(--sm-muted); }
.sm-mini strong { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }

.sm-chart { position: relative; height: 210px; margin-top: 10px; }
.sm-chart__grid {
	position: absolute; inset: 8px 0 24px 0;
	display: flex; flex-direction: column; justify-content: space-between;
	pointer-events: none;
}
.sm-chart__grid span { position: relative; border-top: 1px dashed var(--sm-line); }
.sm-chart__grid span:last-child { border-top: 1px solid var(--sm-line-strong); }
.sm-chart__grid span::after {
	content: attr(data-v);
	position: absolute; right: 0; top: -9px;
	padding: 0 0 0 6px;
	background: var(--sm-surface);
	font-size: 10.5px; line-height: 16px; color: var(--sm-muted);
}
.sm-chart__grid span:last-child::after { display: none; }
.sm-chart__bars {
	position: absolute; inset: 8px 0 0 0;
	display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px;
}
.sm-chart__col { position: relative; display: grid; grid-template-rows: 1fr 24px; justify-items: center; height: 100%; outline: 0; cursor: default; }
.sm-chart__bar {
	align-self: end;
	width: min(58%, 22px);
	border-radius: 4px 4px 0 0;
	background: var(--sm-primary);
	transition: filter .15s;
}
.sm-chart__label { align-self: center; font-size: 10.5px; color: var(--sm-muted); white-space: nowrap; }
.sm-chart__col::after {
	content: attr(data-tip);
	position: absolute; left: 50%; top: -4px; z-index: 3;
	transform: translate(-50%, -100%);
	padding: 5px 9px;
	border-radius: 8px;
	background: var(--sm-ink); color: #fff;
	font-size: 12px; font-weight: 600; white-space: nowrap;
	opacity: 0; pointer-events: none;
	transition: opacity .15s;
}
.sm-chart__col:nth-child(-n+2)::after { left: 0; transform: translate(0, -100%); }
.sm-chart__col:nth-last-child(-n+2)::after { left: auto; right: 0; transform: translate(0, -100%); }
.sm-chart__col:hover::after, .sm-chart__col:focus-visible::after { opacity: 1; }
.sm-chart__col:hover .sm-chart__bar, .sm-chart__col:focus-visible .sm-chart__bar { filter: brightness(1.18); }
.sm-chart__col:focus-visible .sm-chart__label { color: var(--sm-ink); font-weight: 700; }

.sm-table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.sm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sm-table th { padding: 8px 6px; border-bottom: 1px solid var(--sm-line); color: var(--sm-muted); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.sm-table td { padding: 10px 6px; border-bottom: 1px dashed var(--sm-line); white-space: nowrap; }
.sm-table .sm-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sm-table tfoot th { padding-top: 12px; border-top: 1.5px solid var(--sm-line-strong); border-bottom: 0; color: var(--sm-ink); font-size: 13.5px; }
@media (max-width: 639px) {
	.sm-table--stack thead { display: none; }
	.sm-table--stack, .sm-table--stack tbody { display: block; }
	.sm-table--stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px; padding: 11px 0; border-bottom: 1px dashed var(--sm-line-strong); }
	.sm-table--stack tr:last-child { border-bottom: 0; }
	.sm-table--stack td { padding: 0; border: 0; white-space: normal; }
	.sm-table--stack td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--sm-muted); }
	.sm-table--stack td:nth-child(2) { grid-column: 1; grid-row: 1; font-weight: 600; }
	.sm-table--stack td:nth-child(3) { grid-column: 2; grid-row: 2; justify-self: end; }
	.sm-table--stack td:nth-child(4) { grid-column: 2; grid-row: 1; }
}

/* ---------- Admin ---------- */
.sm-approvals { list-style: none; margin: 0; padding: 0; }
.sm-approval { padding: 14px 0; border-bottom: 1px dashed var(--sm-line-strong); }
.sm-approval:last-child { border-bottom: 0; padding-bottom: 4px; }
.sm-approval__top { display: flex; align-items: flex-start; gap: 12px; }
.sm-approval__main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.sm-approval__main strong { font-size: 14.5px; }
.sm-approval__main span { font-size: 12.5px; color: var(--sm-muted); }
.sm-approval__main small { margin-top: 2px; font-size: 12px; color: var(--sm-ink-2); word-break: break-word; }
.sm-approval__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-left: 52px; }
.sm-approval__actions .sm-btn { --b: var(--sm-primary); }

.sm-checklist { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.sm-checklist li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.5; }
.sm-checklist svg { flex: none; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--sm-primary-50); color: var(--sm-primary); }
.sm-flow { list-style: none; margin: 0; padding: 14px 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; border-radius: 14px; background: var(--sm-bg); }
.sm-flow li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.3; text-align: center; color: var(--sm-ink-2); }
.sm-flow li:not(:last-child)::after {
	content: "";
	position: absolute; top: 21px;
	left: calc(50% + 26px); right: calc(-50% + 24px);
	border-top: 2px dashed var(--sm-line-strong);
}
.sm-flow__ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--sm-line-strong); background: #fff; color: var(--sm-ink-2); }
.sm-flow .is-danger .sm-flow__ico { border-color: #f1b5b0; background: #fdecec; color: var(--sm-red); }
.sm-flow .is-info .sm-flow__ico { border-color: #b7cdf0; background: #eaf1fc; color: var(--sm-blue); }
.sm-flow .is-ok .sm-flow__ico { border-color: color-mix(in srgb, var(--sm-primary) 35%, #fff); background: var(--sm-primary-50); color: var(--sm-primary); }

.sm-search { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0; }
.sm-search__ico { position: absolute; left: 14px; top: 14px; color: var(--sm-muted); pointer-events: none; }
.sm-search input.sm-input { padding-left: 44px; }
.sm-search select.sm-input { width: auto; }
.sm-member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sm-member__top { display: flex; align-items: center; gap: 12px; }
.sm-member__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.sm-member__text strong { font-size: 15px; }
.sm-member__text span { font-size: 12.5px; color: var(--sm-muted); }
.sm-member__nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; padding: 10px; border-radius: 12px; background: var(--sm-bg); }
.sm-member__nums div { min-width: 0; text-align: center; }
.sm-member__nums dt { font-size: 11.5px; color: var(--sm-muted); }
.sm-member__nums dd { margin: 0; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-member__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-member__actions .sm-btn--ghost { --b: var(--sm-navy); }

.sm-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.sm-pager__info { font-size: 13px; color: var(--sm-muted); }

.sm-security { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding: 14px; border-radius: 14px; background: var(--sm-primary-50); color: var(--sm-primary); }
.sm-security > svg { flex: none; }
.sm-security p { margin: 0; font-size: 14px; color: var(--sm-ink); }
.sm-contact { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.sm-contact li { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--sm-line); border-radius: 12px; }
.sm-contact svg { flex: none; color: var(--sm-primary); }
.sm-contact a { text-decoration: none; font-weight: 600; }

/* ---------- Drawer / sidebar ---------- */
.sm-drawer {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px); bottom: 0; left: 0;
	z-index: 60;
	width: min(86vw, 300px);
	display: flex; flex-direction: column;
	overflow-y: auto;
	background: var(--sm-surface);
	box-shadow: 12px 0 40px rgba(0, 0, 0, .16);
	transform: translateX(-104%);
	transition: transform .28s cubic-bezier(.2, .9, .25, 1);
}
.sm-drawer.is-open { transform: none; }
.sm-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(10, 24, 16, .45); animation: sm-fade .2s; }
.sm-drawer__brand {
	position: relative;
	display: flex; align-items: center; gap: 8px;
	padding: 18px 10px 18px 16px;
	background: linear-gradient(160deg, var(--sm-primary), var(--sm-primary-600));
	color: #fff;
}
.sm-drawer__brand::after {
	content: "";
	position: absolute; left: 14px; right: 14px; bottom: 7px;
	height: 2px;
	background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 9px, transparent 9px 15px);
}
.sm-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.sm-brand__logo { flex: none; display: grid; padding: 3px; border-radius: 50%; background: #fff; }
.sm-brand__logo .sm-logo-img { border-radius: 50%; }
.sm-brand__text { min-width: 0; }
.sm-brand__name { display: block; font-family: var(--sm-font-display); font-size: 16.5px; line-height: 1.35; }
.sm-brand__tag { display: block; font-size: 11.5px; opacity: .86; }
.sm-drawer__close { color: #fff; }
.sm-drawer__close:hover { background: rgba(255, 255, 255, .15); }
.sm-drawer__user {
	display: flex; align-items: center; gap: 12px;
	margin: 14px 12px 2px;
	padding: 12px;
	border-radius: 14px;
	background: var(--sm-bg);
	color: var(--sm-ink);
	text-decoration: none;
}
.sm-drawer__user span { min-width: 0; }
.sm-drawer__user strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-drawer__user small { display: block; font-size: 12px; color: var(--sm-muted); }
.sm-drawer__nav { flex: 1; padding: 4px 12px 12px; }
.sm-drawer__label { margin: 16px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; color: var(--sm-muted); }
.sm-drawer__nav ul { list-style: none; margin: 0; padding: 0; }
.sm-drawer__nav a {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	color: var(--sm-ink-2);
	font-size: 14.5px; font-weight: 500;
	text-decoration: none;
	transition: background .15s;
}
.sm-drawer__nav a:hover { background: var(--sm-bg); }
.sm-drawer__nav a.is-active { background: var(--sm-primary-50); color: var(--sm-primary-600); font-weight: 600; }
.sm-drawer__nav a.is-active svg { color: var(--sm-primary); }
.sm-drawer__foot { padding: 12px; border-top: 1px solid var(--sm-line); }
.sm-drawer__logout { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--sm-red); font-weight: 600; text-decoration: none; }
.sm-drawer__logout:hover { background: #fdecec; }

/* ---------- Bottom navigation ---------- */
.sm-bottomnav {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
	display: grid; grid-template-columns: repeat(5, 1fr);
	min-height: var(--sm-nav-h);
	padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--sm-line);
	background: rgba(255, 255, 255, .96);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	box-shadow: 0 -8px 24px rgba(18, 38, 26, .06);
}
.sm-bottomnav a {
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	padding: 2px 0;
	color: var(--sm-muted);
	font-size: 11.5px; font-weight: 500; line-height: 1.3;
	text-decoration: none;
}
.sm-bottomnav__ico { width: 54px; height: 30px; display: grid; place-items: center; border-radius: 99px; transition: background .2s, color .2s; }
.sm-bottomnav a.is-active { color: var(--sm-primary-600); font-weight: 700; }
.sm-bottomnav a.is-active .sm-bottomnav__ico { background: var(--sm-primary-50); color: var(--sm-primary); }

/* ---------- Login ---------- */
.sm-screen-login, .sm-screen-login .sm-app { background: #fff; }
.sm-login { min-height: 100vh; min-height: 100dvh; display: grid; }
.sm-login__brand { display: none; }
.sm-login__panel {
	display: flex; align-items: center; justify-content: center;
	padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
	background: radial-gradient(120% 55% at 50% -12%, var(--sm-primary-50), transparent 70%), #fff;
}
.sm-login__card { width: 100%; max-width: 400px; }
.sm-login__head { text-align: center; }
.sm-login__logo { display: inline-grid; padding: 4px; border-radius: 50%; background: #fff; box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--sm-primary) 50%, transparent); }
.sm-login__logo .sm-logo-img { border-radius: 50%; }
.sm-login__name { margin: 14px 0 2px; font-family: var(--sm-font-display); font-size: 27px; font-weight: 400; line-height: 1.35; color: var(--sm-primary-600); }
.sm-login__tag { margin: 0; font-size: 14px; letter-spacing: .3px; color: var(--sm-muted); }
.sm-login__title {
	display: flex; align-items: center; gap: 12px;
	margin: 22px 0 16px;
	font-size: 18px; font-weight: 700; color: var(--sm-primary);
	white-space: nowrap;
}
.sm-login__title::before, .sm-login__title::after { content: ""; flex: 1; border-top: 2px dashed color-mix(in srgb, var(--sm-primary) 28%, #fff); }
.sm-login .sm-flash { margin-bottom: 14px; }
.sm-login__form { gap: 14px; }
.sm-login__row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sm-login__join { margin: 20px 0 0; font-size: 14px; color: var(--sm-muted); text-align: center; }
.sm-login__copy { margin: 26px 0 0; font-size: 12px; color: var(--sm-muted); text-align: center; }

/* ---------- Regular content ---------- */
.sm-entry__title { margin: 0 0 4px; font-size: 18px; line-height: 1.4; }
.sm-entry__title a { color: inherit; text-decoration: none; }
.sm-entry__meta { margin: 0 0 10px; font-size: 13px; color: var(--sm-muted); }
.sm-entry__thumb img { display: block; width: 100%; margin-bottom: 14px; border-radius: 12px; }
.sm-entry__content { font-size: 15px; line-height: 1.75; overflow-wrap: break-word; }
.sm-entry__content > *:first-child { margin-top: 0; }
.sm-entry__content > *:last-child { margin-bottom: 0; }
.sm-entry__content img { border-radius: 10px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { padding: 6px 12px; border: 1px solid var(--sm-line); border-radius: 10px; background: #fff; text-decoration: none; }
.page-numbers.current { background: var(--sm-primary); border-color: var(--sm-primary); color: #fff; }

/* ---------- Animations ---------- */
@keyframes sm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sm-sheet-up { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes sm-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sm-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.sm-content > * { animation: sm-rise .38s cubic-bezier(.2, .9, .25, 1) both; }
.sm-content > *:nth-child(2) { animation-delay: .04s; }
.sm-content > *:nth-child(3) { animation-delay: .08s; }
.sm-content > *:nth-child(4) { animation-delay: .12s; }
.sm-content > *:nth-child(n+5) { animation-delay: .16s; }
.sm-content > .sm-sticky-cta { animation: none; }

/* ---------- Small phones ---------- */
@media (max-width: 370px) {
	.sm-stat__value { font-size: 18px; }
	.sm-hero__value { font-size: 25px; }
	.sm-grid-2 { grid-template-columns: 1fr; }
	.sm-tiles--4 { grid-template-columns: repeat(2, 1fr); }
	.sm-topbar__inner { grid-template-columns: 84px 1fr 84px; }
}
@media (max-width: 600px) {
	body.admin-bar .sm-topbar { top: 0; }
}

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
	dialog.sm-sheet { margin: auto; border-radius: 22px; max-height: 86vh; }
	dialog.sm-sheet[open] { animation-name: sm-pop; }
	.sm-sheet__grab { display: none; }
	.sm-sheet__head { padding-top: 16px; }
	.sm-content { max-width: 720px; padding-left: 24px; padding-right: 24px; }
	.sm-chips { margin: -4px -24px; padding: 4px 24px; }
	.sm-mini-stats { grid-template-columns: repeat(3, 1fr); }
	.sm-mini:last-child:nth-child(odd) { grid-column: auto; }
}

/* ---------- Desktop: sidebar layout ---------- */
@media (min-width: 960px) {
	:root { --sm-nav-h: 0px; }
	.sm-has-shell .sm-app { display: grid; grid-template-columns: 276px minmax(0, 1fr); }
	.sm-has-shell .sm-drawer {
		position: sticky;
		top: var(--wp-admin--admin-bar--height, 0px);
		height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
		width: auto;
		transform: none;
		box-shadow: none;
		border-right: 1px solid var(--sm-line);
		z-index: 31;
	}
	.sm-drawer__close, .sm-overlay, .sm-bottomnav, .sm-topbar [data-drawer-toggle] { display: none !important; }
	.sm-main { padding-bottom: 40px; }
	.sm-topbar__inner { height: 64px; padding: 0 18px; }
	.sm-topbar__title { font-size: 18px; }
	.sm-content { max-width: 1100px; padding: 28px 32px 40px; gap: 20px; }
	.sm-chips { margin: -4px 0; padding: 4px 0; flex-wrap: wrap; overflow: visible; }
	.sm-stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
	.sm-stat { min-height: 132px; padding: 18px; }
	.sm-stat__value { font-size: 23px; }
	.sm-split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
	.sm-sticky-cta { position: static; max-width: 340px; }
	.sm-grid-cards, .sm-people, .sm-member-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sm-content .sm-tiles { grid-template-columns: repeat(5, 1fr); }
	.sm-content .sm-tiles--admin { grid-template-columns: repeat(6, 1fr); }
	.sm-content .sm-tiles--4 { grid-template-columns: repeat(4, 1fr); }
	.sm-mini-stats { grid-template-columns: repeat(5, 1fr); }
	.sm-hero { padding: 24px 26px; }
	.sm-hero__value { font-size: 34px; }
	.sm-chart { height: 240px; }
	.sm-screen-rules .sm-content, .sm-screen-profile .sm-content { max-width: 960px; }

	.sm-login { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
	.sm-login__brand {
		position: relative;
		display: flex; align-items: center; justify-content: center;
		padding: 56px;
		overflow: hidden;
		color: #fff;
		background:
			url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 7 49 28 28 49 7 28z' fill='none' stroke='%23fff' stroke-opacity='.13' stroke-width='1.5' stroke-dasharray='3 3.5'/%3E%3Ccircle cx='28' cy='28' r='2.2' fill='%23fff' fill-opacity='.16'/%3E%3Ccircle cx='0' cy='0' r='1.6' fill='%23fff' fill-opacity='.12'/%3E%3Ccircle cx='56' cy='56' r='1.6' fill='%23fff' fill-opacity='.12'/%3E%3C/svg%3E"),
			linear-gradient(150deg, var(--sm-primary), var(--sm-primary-600) 60%, color-mix(in srgb, var(--sm-primary) 50%, #000));
	}
	.sm-login__brand::after {
		content: "";
		position: absolute; inset: 22px;
		border: 2px dashed rgba(255, 255, 255, .22);
		border-radius: 28px;
		pointer-events: none;
	}
	.sm-login__brand-inner { position: relative; z-index: 1; max-width: 440px; }
	.sm-login__emblem { display: inline-grid; padding: 6px; border-radius: 50%; background: #fff; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45); }
	.sm-login__emblem .sm-logo-img { border-radius: 50%; }
	.sm-login__brand-name { margin: 22px 0 6px; font-family: var(--sm-font-display); font-size: 40px; line-height: 1.3; }
	.sm-login__brand-tag { margin: 0; font-size: 17px; letter-spacing: .5px; opacity: .88; }
	.sm-login__points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 12px; }
	.sm-login__points li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
	.sm-login__points svg { flex: none; width: 38px; height: 38px; padding: 9px; border-radius: 12px; background: rgba(255, 255, 255, .14); }
	.sm-login__head { display: none; }
	.sm-login__title { margin-top: 0; font-size: 22px; }
	.sm-login__panel { background: #fff; }
}

@media (min-width: 1280px) {
	.sm-content .sm-tiles:not(.sm-tiles--4):not(.sm-tiles--admin) { grid-template-columns: repeat(9, 1fr); }
	.sm-grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sm-people, .sm-member-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	@page { margin: 14mm; }
	body.somiti-app { background: #fff; font-size: 12.5px; }
	.sm-topbar, .sm-drawer, .sm-overlay, .sm-bottomnav, .sm-sticky-cta, .sm-noprint, .sm-flash, .sm-skip, dialog, #wpadminbar { display: none !important; }
	.sm-has-shell .sm-app { display: block; }
	.sm-main { padding: 0; }
	.sm-content { max-width: none; padding: 0; gap: 10px; }
	.sm-content > * { animation: none; }
	.sm-card, .sm-hero, .sm-mini, .sm-profile { box-shadow: none; border-color: #bbb; break-inside: avoid; }
	.sm-print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 2px solid #000; font-size: 14px; }
	.sm-stat, .sm-chart__bar, .sm-badge, .sm-mini { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.sm-table-wrap { overflow: visible; margin: 0; padding: 0; }
	a { color: inherit; text-decoration: none; }
}
