/* Neytandinn — site components on top of Tabler. Tokens first; components use only tokens. */
:root {
	--ny-ink: #1b2431;
	--ny-muted: #6a7585;
	--ny-line: #e3e7ee;
	--ny-card: #ffffff;
	--ny-accent: #1f8a55;
	--ny-accent-soft: #e4f3ea;
	--ny-up: #c0392b;
	--ny-up-soft: #fbe9e6;
	--ny-down: #1f8a55;
	--ny-down-soft: #e4f3ea;
	--ny-warn-soft: #fff4d6;
	--ny-chip: #eef1f5;
}

/* identity band */
.ny-band { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: stretch; margin-bottom: 16px; }
.ny-who { display: flex; gap: 16px; align-items: center; }
.ny-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--ny-accent-soft); color: var(--ny-accent); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.ny-who h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.ny-facts { color: var(--ny-muted); margin-top: 4px; }
.ny-facts span + span::before { content: "·"; margin: 0 8px; color: var(--ny-line); }
.ny-drop { border: 2px dashed var(--ny-line); border-radius: 8px; background: var(--ny-card); padding: 10px 14px; }
.ny-drop .filepond--root { margin-bottom: 0; }

/* section nav */
.ny-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--ny-line); margin-bottom: 18px; }
.ny-tabs a { padding: 10px 14px; color: var(--ny-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.ny-tabs a.on { color: var(--ny-ink); border-bottom-color: var(--ny-accent); }
.ny-tabs a:hover { text-decoration: none; color: var(--ny-ink); }
.ny-tabs .badge { margin-left: 6px; }

/* tiles */
.ny-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.ny-tile { background: var(--ny-card); border: 1px solid var(--ny-line); border-radius: 8px; padding: 14px 16px; }
.ny-tile .lbl { color: var(--ny-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.ny-tile .val { font-size: 26px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1.2; }
.ny-tile .val small { font-size: 14px; color: var(--ny-muted); font-weight: 500; }
.ny-tile .cmp { font-size: 12px; color: var(--ny-muted); }
.ny-up { color: var(--ny-up); font-weight: 600; }
.ny-down { color: var(--ny-down); font-weight: 600; }

/* charts */
.ny-charts { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ny-chart { height: 240px; }
.ny-two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.ny-stack { display: grid; gap: 16px; }

/* lists and rows */
.ny-list { list-style: none; margin: 0; padding: 0; }
.ny-list li { display: flex; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--ny-line); align-items: baseline; }
.ny-list li:last-child { border-bottom: 0; }
.ny-list .n { color: var(--ny-muted); font-size: 12px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ny-meta { color: var(--ny-muted); font-size: 12px; }
.ny-hit { background: var(--ny-warn-soft); border-radius: 3px; padding: 0 3px; }
.ny-rcell { display: flex; gap: 10px; align-items: center; }
.ny-thumb { width: 34px; height: 44px; border-radius: 3px; border: 1px solid var(--ny-line); object-fit: cover; flex: none; background: var(--ny-chip); }
.ny-pill { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ny-pill.up { background: var(--ny-up-soft); color: var(--ny-up); }
.ny-pill.down { background: var(--ny-down-soft); color: var(--ny-down); }
.ny-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ny-chip { background: var(--ny-chip); border-radius: 12px; padding: 3px 10px; font-size: 12px; color: var(--ny-ink); text-decoration: none; }
.ny-periods .ny-chip { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.ny-months .ny-chip { min-width: 36px; padding: 2px 8px; font-size: 11.5px; }
.ny-chip-empty { opacity: .35; cursor: default; }
.ny-chip.on { background: var(--ny-accent-soft); color: var(--ny-accent); font-weight: 600; }
.ny-chip:hover { text-decoration: none; }
.ny-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ny-drill-title { display: flex; align-items: center; gap: 8px; }

@media (max-width: 980px) {
	.ny-band, .ny-charts, .ny-two, .ny-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.ny-band, .ny-charts, .ny-two, .ny-tiles { grid-template-columns: 1fr; }
}

/* receipt previews as tiles */
.ny-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ny-grid-month { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ny-muted); }
.ny-grid-month::after { content: ""; flex: 1; height: 1px; background: var(--ny-line); }
.ny-grid-month:first-child { margin-top: 0; }
.ny-tile-receipt { display: block; border: 1px solid var(--ny-line); border-radius: 6px; overflow: hidden; background: var(--ny-card); color: var(--ny-ink); text-decoration: none; }
.ny-tile-receipt:hover { text-decoration: none; border-color: var(--ny-accent); }
.ny-tile-img { display: block; width: 100%; height: 190px; object-fit: cover; object-position: top; background: var(--ny-chip); }
.ny-tile-empty { display: grid; place-items: center; color: var(--ny-muted); font-size: 12px; }
.ny-tile-cap { padding: 6px 8px; font-size: 12px; line-height: 1.35; }
.ny-view { display: inline-flex; border: 1px solid var(--ny-line); border-radius: 6px; overflow: hidden; }
.ny-view a { padding: 3px 10px; font-size: 12px; color: var(--ny-muted); text-decoration: none; }
.ny-view a.on { background: var(--ny-accent-soft); color: var(--ny-accent); font-weight: 600; }
.ny-view a:hover { text-decoration: none; }
.ny-group th { background: var(--ny-chip); font-size: 12px; text-transform: none; letter-spacing: 0; }

/* chain marks */
.ny-chain-icon { width: 22px; height: 22px; border-radius: 5px; vertical-align: middle; margin-right: 6px; object-fit: cover; flex: none; }
.ny-chain-wordmark { vertical-align: middle; }
.ny-chain-name { font-weight: 600; }
.ny-chain-fallback { display: inline-grid; place-items: center; background: var(--ny-chip); color: var(--ny-muted); font-size: 11px; font-weight: 700; }

.ny-product-row td { color: var(--ny-muted); }
.ny-product-row td:first-child a { color: var(--ny-accent); }

.ny-matrix { font-size: 12px; }
.ny-matrix th, .ny-matrix td { padding: 4px 8px; }
.ny-matrix td.ny-num a:hover { text-decoration: underline; }
/* Row and column striping done by hand: Tabler's table-striped paints rows with an inset
   box-shadow that would cover the column tint. Rows get a background colour, columns a
   translucent background image, and the two layer. */
.ny-matrix tbody tr:nth-child(even) td { background-color: rgba(0, 0, 0, .03); }
.ny-matrix th:nth-child(2n+1):not(:first-child):not(:last-child), .ny-matrix td:nth-child(2n+1):not(:first-child):not(:last-child) { background-image: linear-gradient(rgba(0, 0, 0, .025), rgba(0, 0, 0, .025)); }
.ny-matrix thead th { border-bottom: 2px solid #d9dde3; }
.ny-matrix th:last-child, .ny-matrix td:last-child { border-left: 2px solid #d9dde3; background-image: linear-gradient(rgba(0, 0, 0, .035), rgba(0, 0, 0, .035)); }
.ny-matrix tfoot td, .ny-matrix tr.ny-matrix-total td { border-top: 2px solid #d9dde3; font-weight: 600; }
.ny-matrix tbody tr:hover td { background-image: linear-gradient(rgba(0, 0, 0, .06), rgba(0, 0, 0, .06)); }
.ny-matrix td:first-child { white-space: nowrap; }
