/* JPEX Sales Reports — console
   Palette: sumi ink + aizome indigo, with mizu teal for money owed to JPEX
   and beni red for money JPEX owes out. Money is always mono + tabular.
   ------------------------------------------------------------------ */

.jsr {
	--paper: #f4f5f8;
	--surface: #ffffff;
	--surface-2: #fafbfd;
	--surface-3: #f1f3f8;
	--ink: #0c1019;
	--ink-2: #5c6478;
	--ink-3: #949cb0;
	--line: #e3e6ef;
	--line-2: #eef0f6;
	--indigo: #1e2f63;
	--indigo-2: #33509e;
	--indigo-wash: #edf0f8;
	--mizu: #0b7c88;
	--mizu-wash: #e6f4f5;
	--beni: #c0344a;
	--beni-wash: #fbeaed;
	--kin: #8d6b1f;
	--kin-wash: #f7f1e2;

	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;
	--r-xl: 24px;

	--shadow-1: 0 1px 2px rgba(12, 16, 25, .05);
	--shadow-2: 0 6px 20px -8px rgba(12, 16, 25, .18), 0 1px 2px rgba(12, 16, 25, .04);
	--shadow-3: 0 28px 70px -24px rgba(12, 16, 25, .38);

	--sans: ui-sans-serif, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

	--ease: cubic-bezier(.22, .78, .3, 1);
	--rail: 232px;
	--topbar: 32px;

	font-family: var(--sans);
	color: var(--ink);
	background: var(--paper);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
}

.jsr[data-theme="dark"] {
	--paper: #080b11;
	--surface: #111621;
	--surface-2: #161c29;
	--surface-3: #1b2231;
	--ink: #eceff6;
	--ink-2: #99a3b9;
	--ink-3: #6c768d;
	--line: #232b3b;
	--line-2: #1c2230;
	--indigo: #8ba4ee;
	--indigo-2: #a3b8f5;
	--indigo-wash: #17203a;
	--mizu: #40c9d3;
	--mizu-wash: #0f2a2e;
	--beni: #f38495;
	--beni-wash: #2c151b;
	--kin: #d9ae58;
	--kin-wash: #2a2415;
	--shadow-2: 0 6px 20px -8px rgba(0, 0, 0, .6);
	--shadow-3: 0 28px 70px -24px rgba(0, 0, 0, .8);
}

.jsr *, .jsr *::before, .jsr *::after { box-sizing: inherit; }
.jsr button, .jsr input, .jsr select, .jsr textarea { font: inherit; color: inherit; }

/* wp-admin full bleed */
.jsr-wrap { margin: 0 0 0 -20px; }
@media (max-width: 782px) { .jsr-wrap { margin-left: -10px; } }
.jsr-screen #wpcontent { padding-left: 0; }
.jsr-screen #wpbody-content { padding-bottom: 0; }
.jsr-screen #wpfooter { display: none; }

/* ------------------------------------------------------------------ *
 * Shell
 * ------------------------------------------------------------------ */

.jsr__shell {
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	min-height: 100vh;
	background: var(--paper);
}
.jsr--front { --topbar: 0px; }

/* Standalone front-end console page */
body.jsr-console { margin: 0; padding: 0; background: var(--paper); }
body.jsr-console #wpadminbar { position: fixed; }
.jsr--page { --topbar: 0px; }
body.admin-bar .jsr--page { --topbar: 32px; }
.jsr--page .jsr__shell { min-height: calc(100vh - var(--topbar)); }
.jsr--front .jsr__shell { min-height: 82vh; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-2); }

/* Rail */
.jsr__rail {
	background: var(--surface);
	border-right: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 22px 14px 16px;
	position: sticky;
	top: var(--topbar);
	align-self: start;
	height: calc(100vh - var(--topbar));
	overflow-y: auto;
}
.jsr--front .jsr__rail { position: static; height: auto; }

.jsr__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.jsr__mark {
	width: 34px; height: 34px; border-radius: 10px; flex: none;
	background: linear-gradient(150deg, var(--indigo) 0%, var(--indigo-2) 100%);
	color: #fff; display: grid; place-items: center;
	font-weight: 700; font-size: 12px; letter-spacing: .04em;
	box-shadow: 0 4px 12px -4px rgba(30, 47, 99, .55);
}
.jsr[data-theme="dark"] .jsr__mark { color: #0a0d14; }
.jsr__brandtext { min-width: 0; }
.jsr__brandname { font-weight: 650; letter-spacing: -.015em; font-size: 14px; line-height: 1.2; }
.jsr__brandsub { font-size: 11px; color: var(--ink-3); letter-spacing: .02em; }

.jsr__navlabel {
	font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
	color: var(--ink-3); font-weight: 650; padding: 14px 10px 6px;
}
.jsr__nav { display: flex; flex-direction: column; gap: 2px; }
.jsr__navitem {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 10px; border-radius: var(--r-sm);
	background: none; border: 0; cursor: pointer; width: 100%;
	text-align: left; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
	transition: background .15s var(--ease), color .15s var(--ease);
}
.jsr__navitem:hover { background: var(--surface-3); color: var(--ink); }
.jsr__navitem[aria-current="true"] { background: var(--indigo-wash); color: var(--indigo); font-weight: 600; }
.jsr__navitem svg { width: 17px; height: 17px; flex: none; stroke-width: 1.7; }
.jsr__navcount {
	margin-left: auto; font-family: var(--mono); font-size: 11px;
	background: var(--surface-3); color: var(--ink-2);
	padding: 1px 6px; border-radius: 20px;
}
.jsr__navitem[aria-current="true"] .jsr__navcount { background: #fff; color: var(--indigo); }
.jsr[data-theme="dark"] .jsr__navitem[aria-current="true"] .jsr__navcount { background: var(--surface); }

.jsr__railfoot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* Top bar */
.jsr__main { min-width: 0; display: flex; flex-direction: column; }
.jsr__top {
	position: sticky; top: var(--topbar); z-index: 30;
	display: flex; align-items: center; gap: 14px;
	padding: 14px 26px; background: color-mix(in srgb, var(--paper) 86%, transparent);
	backdrop-filter: blur(14px) saturate(1.4);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	border-bottom: 1px solid var(--line);
}

.jsr__title { font-size: 19px; font-weight: 660; letter-spacing: -.025em; margin: 0; }
.jsr__subtitle { font-size: 12px; color: var(--ink-3); margin: 1px 0 0; }
.jsr__topspacer { margin-left: auto; }
.jsr__topactions { display: flex; align-items: center; gap: 8px; }

.jsr__content { padding: 24px 26px 90px; }

@media screen and (max-width: 782px) {
	.jsr { --topbar: 46px; }
	.jsr--front { --topbar: 0px; }
	body.admin-bar .jsr--page { --topbar: 46px; }
}

/* ------------------------------------------------------------------ *
 * Controls
 * ------------------------------------------------------------------ */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	height: 34px; padding: 0 13px; border-radius: 9px;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink);
	font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
	box-shadow: var(--shadow-1);
	transition: background .14s var(--ease), border-color .14s var(--ease), transform .14s var(--ease), box-shadow .14s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; stroke-width: 1.8; }
.btn--primary {
	background: var(--indigo); border-color: var(--indigo); color: #fff;
	box-shadow: 0 4px 14px -6px rgba(30, 47, 99, .7);
}
.btn--primary:hover { background: var(--indigo-2); border-color: var(--indigo-2); }
.jsr[data-theme="dark"] .btn--primary { color: #0a0d14; }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--danger { color: var(--beni); border-color: var(--beni-wash); background: var(--beni-wash); box-shadow: none; }
.btn--danger:hover { background: var(--beni); color: #fff; border-color: var(--beni); }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn--icon { width: 34px; padding: 0; }
.btn--icon.btn--sm { width: 28px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label {
	font-size: 10px; text-transform: uppercase; letter-spacing: .13em;
	font-weight: 650; color: var(--ink-3);
}
.field__hint { font-size: 11.5px; color: var(--ink-3); }
.input, .select, .textarea {
	height: 36px; padding: 0 11px; border-radius: 9px;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink);
	font-size: 13.5px; width: 100%;
	transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
	outline: none; border-color: var(--indigo);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 16%, transparent);
}
.input--money { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.select {
	appearance: none; -webkit-appearance: none; padding-right: 30px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a92a6' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}

.switchrow { display: flex; align-items: center; gap: 8px; }

.tick {
	display: flex; align-items: center; gap: 9px;
	padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md);
	background: var(--surface-2); font-size: 13px; cursor: pointer;
}
.tick input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--mizu); cursor: pointer; flex: none; }
.tick > span:first-of-type { flex: 1; }
.tick__rate { width: 68px; flex: none; text-align: right; }
.tick__unit { color: var(--ink-3); font-size: 12px; }
.seg {
	display: inline-flex; padding: 3px; gap: 2px;
	background: var(--surface-3); border-radius: 9px; border: 1px solid var(--line-2);
}
.seg__btn {
	border: 0; background: none; cursor: pointer; border-radius: 6px;
	padding: 5px 11px; font-size: 12px; font-weight: 550; color: var(--ink-2);
	transition: background .14s var(--ease), color .14s var(--ease);
}
.seg__btn:hover { color: var(--ink); }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg__btn[data-tone="us"][aria-pressed="true"] { color: var(--mizu); }
.seg__btn[data-tone="vendor"][aria-pressed="true"] { color: var(--beni); }
.seg__btn[data-tone="mix"][aria-pressed="true"] { color: var(--indigo-2); }

.search { position: relative; }
.search .input { padding-left: 32px; }
.search svg {
	position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
	width: 15px; height: 15px; color: var(--ink-3); stroke-width: 1.8; pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Cards / layout blocks
 * ------------------------------------------------------------------ */

.card {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.card__head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 18px; border-bottom: 1px solid var(--line-2);
}
.card__title { font-size: 14px; font-weight: 640; letter-spacing: -.01em; margin: 0; }
.card__sub { font-size: 11.5px; color: var(--ink-3); margin: 2px 0 0; }
.card__body { padding: 18px; }
.card__actions { margin-left: auto; display: flex; gap: 7px; }

.eyebrow {
	font-size: 10px; text-transform: uppercase; letter-spacing: .14em;
	font-weight: 650; color: var(--ink-3); margin: 0 0 6px;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.nil { color: var(--ink-3); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--r-md); padding: 14px 15px 13px;
	position: relative; overflow: hidden; box-shadow: var(--shadow-1);
	animation: jsr-rise .45s var(--ease) both;
}
.kpi::after {
	content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
	background: var(--line); border-radius: 3px;
}
.kpi--in::after { background: var(--mizu); }
.kpi--out::after { background: var(--beni); }
.kpi--primary::after { background: var(--indigo); }
.kpi--gold::after { background: var(--kin); }
.kpi__label { font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 650; color: var(--ink-3); }
.kpi__value { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -.035em; margin-top: 5px; display: block; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: .04em; margin-right: 5px; }
.kpi__foot { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.kpi--in .kpi__value { color: var(--mizu); }
.kpi--out .kpi__value { color: var(--beni); }

@keyframes jsr-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.kpi:nth-child(2) { animation-delay: .04s; }
.kpi:nth-child(3) { animation-delay: .08s; }
.kpi:nth-child(4) { animation-delay: .12s; }

/* ------------------------------------------------------------------ *
 * Signature: the net position meter (zero axis in the middle)
 * ------------------------------------------------------------------ */

.meter { padding: 20px 22px 18px; }
.meter__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.meter__verdict { font-size: 15px; font-weight: 620; letter-spacing: -.015em; }
.meter__verdict b { font-family: var(--mono); font-weight: 600; letter-spacing: -.03em; }
.meter__verdict--in b { color: var(--mizu); }
.meter__verdict--out b { color: var(--beni); }
.meter__note { font-size: 12px; color: var(--ink-3); margin-left: auto; }

.meter__track {
	position: relative; height: 46px; border-radius: 10px;
	background: var(--surface-3); overflow: hidden;
}
.meter__axis { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--ink-3); opacity: .5; z-index: 2; }
.meter__bar {
	position: absolute; top: 8px; bottom: 8px; border-radius: 6px;
	transition: width .5s var(--ease), left .5s var(--ease), right .5s var(--ease);
}
.meter__bar--out { right: 50%; background: linear-gradient(90deg, color-mix(in srgb, var(--beni) 62%, transparent), var(--beni)); border-radius: 6px 2px 2px 6px; }
.meter__bar--in { left: 50%; background: linear-gradient(90deg, var(--mizu), color-mix(in srgb, var(--mizu) 62%, transparent)); border-radius: 2px 6px 6px 2px; }
.meter__ends { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; }
.meter__end { display: flex; flex-direction: column; gap: 1px; }
.meter__end--right { text-align: right; }
.meter__end span:first-child { font-size: 10px; text-transform: uppercase; letter-spacing: .13em; font-weight: 650; color: var(--ink-3); }
.meter__end b { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: -.02em; }
.meter__end--left b { color: var(--beni); }
.meter__end--right b { color: var(--mizu); }

/* Day bars */
.daybars { display: flex; gap: 10px; align-items: flex-end; height: 132px; padding: 4px 2px 0; }
.daybar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; min-width: 0; }
.daybar__stack { position: relative; border-radius: 7px 7px 3px 3px; background: var(--indigo-wash); overflow: hidden; transition: height .5s var(--ease); }
.daybar__held { position: absolute; inset: auto 0 0 0; background: var(--indigo); transition: height .5s var(--ease); }
.daybar__meta { text-align: center; }
.daybar__label { font-size: 11px; font-weight: 600; }
.daybar__value { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: -.02em; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------------ *
 * Tables
 * ------------------------------------------------------------------ */

.tablewrap { overflow: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
	position: sticky; top: 0; z-index: 5;
	background: var(--surface-2); text-align: left; font-weight: 600;
	font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
	padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl th small { display: block; font-size: 10px; letter-spacing: .04em; text-transform: none; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl tfoot td {
	position: sticky; bottom: 0; background: var(--surface-2);
	border-top: 1px solid var(--line); border-bottom: 0;
	font-weight: 640; z-index: 4;
}
.tbl .strong { font-weight: 620; }
.tbl__vendor { font-weight: 600; letter-spacing: -.01em; }
.tbl__vendor small { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; letter-spacing: 0; }

/* Grid (spreadsheet) */
.gridwrap { overflow: auto; max-height: calc(100vh - var(--topbar) - 218px); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.jsr--front .gridwrap { max-height: 70vh; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th {
	position: sticky; top: 0; z-index: 6; background: var(--surface-2);
	font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
	font-weight: 650; color: var(--ink-3); text-align: right;
	padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid th small { display: block; text-transform: none; letter-spacing: .02em; font-weight: 500; font-size: 10px; margin-top: 1px; }
.grid th.sticky-l, .grid td.sticky-l {
	position: sticky; left: 0; z-index: 7; background: var(--surface);
	text-align: left; box-shadow: 1px 0 0 var(--line);
	min-width: 232px; max-width: 260px;
}
.grid th.sticky-l { z-index: 8; background: var(--surface-2); }
.grid tbody tr:hover td.sticky-l { background: var(--surface-2); }
.grid td { padding: 0; border-bottom: 1px solid var(--line-2); }
.grid tbody tr:hover { background: var(--surface-2); }
.grid tbody tr.is-active td { background: var(--indigo-wash); }
.grid tbody tr.is-active td.sticky-l { background: var(--indigo-wash); }

.gridname { display: flex; align-items: center; gap: 9px; padding: 8px 12px; }
.gridname__text { min-width: 0; }
.gridname__title { font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gridname__sub { font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.gridname__grip { color: var(--ink-3); cursor: grab; opacity: 0; transition: opacity .14s var(--ease); }
.grid tbody tr:hover .gridname__grip { opacity: 1; }
.grid tbody tr.is-drag { opacity: .4; }
.grid tbody tr.is-over td { box-shadow: inset 0 2px 0 var(--indigo); }

.cell { position: relative; }
.cell__input {
	width: 100%; height: 38px; border: 0; background: none; padding: 0 12px 0 10px;
	text-align: right; font-family: var(--mono); font-size: 13px;
	font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink);
	border-radius: 0; transition: box-shadow .12s var(--ease), background .12s var(--ease);
}
.cell__input::placeholder { color: var(--ink-3); }
.cell__input:hover { background: var(--surface-3); }
.cell__input:focus {
	outline: none; background: var(--surface);
	box-shadow: inset 0 0 0 2px var(--indigo);
	position: relative; z-index: 3;
}
.cell--us .cell__input { background: color-mix(in srgb, var(--mizu-wash) 70%, transparent); }
.cell--us .cell__input:hover { background: var(--mizu-wash); }
.cell__flag {
	position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
	width: 5px; height: 5px; border-radius: 50%; background: var(--mizu); pointer-events: none;
}
.cell--override .cell__flag { box-shadow: 0 0 0 2px color-mix(in srgb, var(--mizu) 30%, transparent); }
.cell--vendor.cell--override .cell__flag { background: var(--beni); box-shadow: 0 0 0 2px color-mix(in srgb, var(--beni) 30%, transparent); }

/* A cell whose takings were split between JPEX and the vendor */
.cell--split .cell__input {
	height: 30px;
	background: linear-gradient(90deg, color-mix(in srgb, var(--mizu-wash) 70%, transparent) 0 50%, color-mix(in srgb, var(--beni-wash) 60%, transparent) 50% 100%);
}
.cell--split .cell__flag { background: linear-gradient(90deg, var(--mizu) 0 50%, var(--beni) 50% 100%); }
.cell__split {
	position: absolute; left: 0; right: 0; bottom: 1px;
	display: flex; align-items: center; justify-content: flex-end; gap: 4px;
	padding: 0 12px 0 10px; pointer-events: none;
	font-family: var(--mono); font-variant-numeric: tabular-nums;
	font-size: 10px; letter-spacing: -.01em; color: var(--ink-3);
}
.cell__split b { color: var(--mizu); font-weight: 620; }
.cell__split i { font-style: normal; color: var(--line-2); padding: 0 1px; }
.cell__pair { font-size: 11px; color: var(--ink-2); }

/* Online / website columns sit apart from the show days */
.th--online, .cell--online { background: color-mix(in srgb, var(--indigo-wash) 45%, transparent); }
.th--online { border-left: 2px solid var(--indigo-wash) !important; }
.cell--online { border-left: 2px solid var(--indigo-wash); }

/* Split meter, used in the editor and the vendor drawer */
.splitbar {
	display: block; height: 6px; border-radius: 999px; overflow: hidden;
	background: color-mix(in srgb, var(--beni) 55%, var(--surface-3));
	margin: 10px 0 6px;
}
.splitbar__us { display: block; height: 100%; background: var(--mizu); transition: width .18s var(--ease); }
.splitbar__key { display: flex; gap: 16px; font-size: 11px; color: var(--ink-3); }
.splitbar__key .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot--in { background: var(--mizu); }
.dot--out { background: var(--beni); }

.pct { display: flex; align-items: center; justify-content: flex-end; gap: 1px; padding-right: 4px; }
.pct__input {
	width: 52px; height: 30px; border: 1px solid transparent; background: none;
	text-align: right; font-family: var(--mono); font-size: 12.5px; padding: 0 4px;
	border-radius: 6px; font-variant-numeric: tabular-nums;
}
.pct__input:hover { border-color: var(--line); background: var(--surface-3); }
.pct__input:focus { outline: none; border-color: var(--indigo); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 14%, transparent); }
.pct__sign { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }

.gridcalc { padding: 9px 12px; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gridcalc--muted { color: var(--ink-2); }
.gridbal { padding: 7px 12px; text-align: right; }
.gridbal__value { font-family: var(--mono); font-weight: 620; font-size: 13px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.gridbal--in .gridbal__value { color: var(--mizu); }
.gridbal--out .gridbal__value { color: var(--beni); }
.gridbal--done .gridbal__value { color: var(--ink-3); }
.gridbal__who { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 600; }

/* Tags */
.tag {
	display: inline-flex; align-items: center; gap: 5px;
	font-size: 10.5px; font-weight: 620; letter-spacing: .04em;
	padding: 3px 8px; border-radius: 20px; white-space: nowrap;
	background: var(--surface-3); color: var(--ink-2);
}
.tag--in { background: var(--mizu-wash); color: var(--mizu); }
.tag--out { background: var(--beni-wash); color: var(--beni); }
.tag--mix { background: var(--indigo-wash); color: var(--indigo-2); }
.tag--mix i { background: linear-gradient(90deg, var(--mizu) 0 50%, var(--beni) 50% 100%); }
.tag--done { background: var(--kin-wash); color: var(--kin); }
.tag--mixed { background: var(--indigo-wash); color: var(--indigo); }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ------------------------------------------------------------------ *
 * Drawer + modal
 * ------------------------------------------------------------------ */

.scrim {
	position: fixed; inset: 0; z-index: 100000;
	background: rgba(9, 12, 20, .42); backdrop-filter: blur(3px);
	animation: jsr-fade .18s var(--ease);
	display: flex;
}
@keyframes jsr-fade { from { opacity: 0; } to { opacity: 1; } }

/* A modal stacked on an open drawer: only tint once. */
.scrim + .scrim { background: rgba(9, 12, 20, .24); backdrop-filter: none; }

.drawer {
	margin-left: auto; width: min(480px, 100%); height: 100%;
	background: var(--surface); border-left: 1px solid var(--line);
	box-shadow: var(--shadow-3); display: flex; flex-direction: column;
	animation: jsr-slide .28s var(--ease);
}
@keyframes jsr-slide { from { transform: translateX(26px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-2); }
.drawer__title { font-size: 17px; font-weight: 640; letter-spacing: -.02em; margin: 0; }
.drawer__sub { font-size: 12px; color: var(--ink-3); margin: 2px 0 0; }
.drawer__body { padding: 20px 22px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.drawer__foot { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; background: var(--surface-2); }
.drawer__foot .btn--primary { margin-left: auto; }

.modal {
	margin: auto; width: min(560px, calc(100% - 32px)); max-height: 88vh; overflow: auto;
	background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
	border: 1px solid var(--line); animation: jsr-pop .24s var(--ease);
}
@keyframes jsr-pop { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { padding: 22px 24px 6px; }
.modal__title { font-size: 18px; font-weight: 650; letter-spacing: -.022em; margin: 0; }
.modal__sub { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; }
.modal__body { padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal__foot { padding: 14px 24px 20px; display: flex; gap: 8px; }
.modal__foot .btn--primary { margin-left: auto; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* Settlement summary block inside drawer */
.recap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.recap__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.recap__row:last-child { border-bottom: 0; }
.recap__row span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.recap__row--rule { border-top: 1px solid var(--line); font-weight: 620; background: var(--surface-2); }
.recap__row--total { background: var(--indigo-wash); font-weight: 660; font-size: 14px; }
.recap__row--total.is-in { background: var(--mizu-wash); color: var(--mizu); }
.recap__row--total.is-out { background: var(--beni-wash); color: var(--beni); }

.dayedit { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.dayedit:last-child { border-bottom: 0; }
.dayedit__name { font-weight: 600; font-size: 13px; min-width: 62px; }
.dayedit__amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); min-width: 78px; text-align: right; }
.dayedit__seg { margin-left: auto; }
.dayedit--stack { display: block; }
.dayedit__top { display: flex; align-items: center; gap: 10px; }
.dayedit__name small { font-weight: 500; color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }
.dayedit__split { display: flex; align-items: center; gap: 10px; padding: 0 0 2px; }
.dayedit__split .splitbar { flex: 1; margin: 6px 0 4px; }
.dayedit__pair { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.dayedit__pair b { color: var(--ink-2); font-weight: 620; }

/* ------------------------------------------------------------------ *
 * Misc
 * ------------------------------------------------------------------ */

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar__spacer { margin-left: auto; }

.empty { text-align: center; padding: 60px 24px; }
.empty__mark { width: 54px; height: 54px; border-radius: 16px; background: var(--indigo-wash); color: var(--indigo); display: grid; place-items: center; margin: 0 auto 16px; }
.empty__mark svg { width: 24px; height: 24px; stroke-width: 1.6; }
.empty__title { font-size: 16px; font-weight: 640; letter-spacing: -.02em; margin: 0 0 5px; }
.empty__text { font-size: 13px; color: var(--ink-2); margin: 0 auto 18px; max-width: 380px; }

.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 100001; display: flex; flex-direction: column; gap: 8px; }
.toast {
	background: var(--ink); color: var(--paper); padding: 10px 15px; border-radius: 10px;
	font-size: 13px; font-weight: 500; box-shadow: var(--shadow-3);
	animation: jsr-toast .26s var(--ease); max-width: 340px;
}
.toast--bad { background: var(--beni); color: #fff; }
@keyframes jsr-toast { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.hint { font-size: 12px; color: var(--ink-3); }
.kbd {
	font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 5px;
	border: 1px solid var(--line); background: var(--surface-3); color: var(--ink-2);
}

.jsr-gate { padding: 40px 24px; text-align: center; font-family: var(--sans); }
body.jsr-console .jsr-gate { min-height: 100vh; display: grid; align-content: center; gap: 4px; background: var(--paper); color: var(--ink); }
.jsr-gate__btn { display: inline-block; padding: 10px 18px; border-radius: 9px; background: #1e2f63; color: #fff; text-decoration: none; font-weight: 600; }

.statlist { display: flex; flex-direction: column; }
.statrow { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.statrow:last-child { border-bottom: 0; }
.statrow__name { font-weight: 550; font-size: 13px; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.statrow__bar { width: 108px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; flex: none; }
.statrow__fill { height: 100%; border-radius: 4px; background: var(--indigo); transition: width .5s var(--ease); }
.statrow__val { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 88px; text-align: right; }

.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; }

.pastebox {
	width: 100%; min-height: 200px; font-family: var(--mono); font-size: 12.5px;
	line-height: 1.6; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
	background: var(--surface-2); resize: vertical; white-space: pre; overflow-x: auto;
}
.pastebox:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--indigo) 14%, transparent); }

.chip {
	display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px;
	border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chiplist { display: flex; flex-direction: column; gap: 8px; }
.chipedit { display: grid; grid-template-columns: minmax(0, 1fr) 168px 34px; gap: 8px; align-items: center; }

/* Responsive */
@media (max-width: 1180px) {
	.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
	.jsr { --rail: 0px; }
	.jsr__shell { grid-template-columns: minmax(0, 1fr); }
	.jsr__rail {
		position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto;
		z-index: 60; flex-direction: row; align-items: center; gap: 2px;
		padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
		border-right: 0; border-top: 1px solid var(--line); overflow-x: auto;
	}
	.jsr__brand, .jsr__navlabel, .jsr__railfoot, .jsr__navcount { display: none; }
	.jsr__nav { flex-direction: row; gap: 2px; }
	.jsr__navitem { flex-direction: column; gap: 3px; font-size: 10px; padding: 7px 12px; white-space: nowrap; }
	.jsr__top { padding: 12px 16px; flex-wrap: wrap; }
	.jsr__content { padding: 16px 16px 110px; }
	.grid2, .grid3 { grid-template-columns: 1fr; }
	.drawer { width: 100%; }
	.gridwrap { max-height: none; }
	.grid th.sticky-l, .grid td.sticky-l { min-width: 168px; }
}

@media (prefers-reduced-motion: reduce) {
	.jsr *, .jsr *::before, .jsr *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

@media print {
	.jsr__rail, .jsr__top, .toolbar, .toasts { display: none !important; }
	.jsr__content { padding: 0; }
}

/* ------------------------------------------------------------------ *
 * Workshops
 * ------------------------------------------------------------------ */

.gridwrap--auto { max-height: none; }
.grid--workshops th, .grid--vouchers th { white-space: nowrap; }
.grid--workshops .cell__input, .grid--vouchers .cell__input { height: 38px; }
.cell__input--count { text-align: right; font-variant-numeric: tabular-nums; }
.cell__input--text { text-align: left; font-family: var(--sans); font-size: 12.5px; letter-spacing: 0; }
.cell--notes { min-width: 240px; }
.th--notes { text-align: left !important; }
.gridcalc--strong { font-weight: 660; color: var(--ink); }
.gridcalc--in { color: var(--mizu); font-weight: 640; }
.gridcalc--out { color: var(--beni); font-weight: 640; }
.grid--vouchers tbody td.sticky-l { font-size: 12.5px; }
.grid--workshops .cell--online .cell__input { background: color-mix(in srgb, var(--indigo-wash) 45%, transparent); }
tr.is-dropzone > td { box-shadow: inset 0 2px 0 var(--indigo); }

/* ------------------------------------------------------------------ *
 * Summary columns: channels, holders, notes, reconciliation
 * ------------------------------------------------------------------ */

.th--left { text-align: left !important; }
.grid td.gridholds {
	padding: 8px 12px; font-size: 11.5px; color: var(--ink-2);
	line-height: 1.4; min-width: 190px; text-align: left;
}
.cell--claim .cell__input { background: color-mix(in srgb, var(--kin) 8%, transparent); }
.cell--ziina .cell__input { background: color-mix(in srgb, var(--beni) 8%, transparent); }
.cell--chan { padding: 0; }
.chanbtn {
	width: 100%; height: 38px; border: 0; background: none; cursor: pointer;
	display: flex; align-items: center; padding: 0 10px;
}
.chan {
	display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
	white-space: nowrap; padding: 3px 9px; border-radius: 999px;
	background: var(--indigo-wash); color: var(--indigo-2);
	font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
tr.is-unreconciled > td.sticky-l { box-shadow: inset 3px 0 0 var(--kin); }

.banner {
	display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
	padding: 10px 14px; border-radius: var(--r-lg); font-size: 12.5px;
	line-height: 1.45; color: var(--ink-2);
	border: 1px solid var(--line); background: var(--surface);
}
.banner svg { width: 17px; height: 17px; flex: none; }
.banner b { color: var(--ink); font-weight: 640; }
.banner--warn { border-color: color-mix(in srgb, var(--kin) 40%, var(--line)); background: color-mix(in srgb, var(--kin) 7%, var(--surface)); }
.banner--warn svg { color: var(--kin); }
.banner .btn { margin-left: auto; flex: none; }

.hint--warn { color: var(--kin); }

/* Column chooser */
.collist { display: grid; gap: 2px; }
.colrow {
	display: flex; align-items: center; gap: 10px; width: 100%;
	padding: 8px 10px; border: 0; border-radius: var(--r-md);
	background: none; cursor: pointer; text-align: left;
	font-family: var(--sans); font-size: 13px; color: var(--ink);
	transition: background .12s var(--ease);
}
.colrow:hover { background: var(--surface-2); }
.colrow__box {
	width: 18px; height: 18px; border-radius: 5px; flex: none;
	border: 1.5px solid var(--line-2); display: grid; place-items: center;
	transition: background .12s var(--ease), border-color .12s var(--ease);
}
.colrow__box svg { width: 12px; height: 12px; color: #fff; stroke-width: 3; }
.colrow[aria-pressed="true"] .colrow__box { background: var(--indigo); border-color: var(--indigo); }
.colrow__label small { color: var(--ink-3); font-weight: 500; }

/* ------------------------------------------------------------------ *
 * Collapsible rail
 * ------------------------------------------------------------------ */

.jsr__rail { transition: width .18s var(--ease); }
.jsr__collapse { margin-top: 2px; color: var(--ink-3); }
.jsr__collapse svg { transition: transform .18s var(--ease); }

.jsr[data-rail="tight"] { --rail: 64px; }
.jsr__rail--tight { padding-left: 8px; padding-right: 8px; }
.jsr__rail--tight .jsr__brandtext,
.jsr__rail--tight .jsr__navlabel,
.jsr__rail--tight .jsr__navitem > span,
.jsr__rail--tight .jsr__navcount { display: none; }
.jsr__rail--tight .jsr__brand { justify-content: center; padding-left: 0; padding-right: 0; }
.jsr__rail--tight .jsr__navitem { justify-content: center; padding-left: 0; padding-right: 0; }
.jsr__rail--tight .jsr__collapse svg { transform: rotate(180deg); }

/* Report document rows with a PDF button */
.doc {
	display: flex; align-items: center; gap: 12px;
	padding: 12px 14px; border: 1px solid var(--line);
	border-radius: var(--r-lg); background: var(--surface-2);
}
.doc__text { display: grid; gap: 2px; min-width: 0; }
.doc__text b { font-size: 13px; font-weight: 620; color: var(--ink); }
.doc__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.doc__actions .btn--ghost { padding: 0 8px; }
