/* Ensure fixed total values are white in dark mode */
.theme-dark .app-fixed-total-value {
	color: #fff !important;
}
@import './_dashboard-overrides.css';
@tailwind base;
@tailwind components;
@tailwind utilities;


@layer base {
	body {
		font-family: 'Plus Jakarta Sans', sans-serif;
	}

	body.app-lock-scroll {
		overflow: hidden;
	}

	:root {
		color-scheme: light;
		--app-bg: #f2f4f8;
		--app-card: #ffffff;
		--app-ink: #18243f;
		--app-muted: #6b7280;
		--app-primary: #0a84ff;
		--app-primary-dark: #0956cc;
		--app-accent: #29b473;
		--app-warn: #f59e0b;
		--app-danger: #ef4444;
	}

	.theme-dark {
		color-scheme: dark;
	}
}

@layer components {
	.app-body {
		background: #f1f5f9;
	}

	/* ══════════════════════════════════════════
	   SIDEBAR LAYOUT
	   ══════════════════════════════════════════ */

	.app-layout {
		display: flex;
		min-height: 100vh;
	}

	/* ── Sidebar ── */
	.app-sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		width: 218px;
		background: #0f172a;
		display: flex;
		flex-direction: column;
		z-index: 40;
		transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
		overflow: hidden;
		border-right: 1px solid rgba(255, 255, 255, 0.055);
	}

	.sidebar-collapsed .app-sidebar {
		width: 62px;
	}

	@media (max-width: 767px) {
		.app-sidebar {
			transform: translateX(-100%);
			transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
			box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
		}

		.app-sidebar.mob-open {
			transform: translateX(0);
		}
	}

	/* ── Sidebar: logo strip ── */
	.app-sidebar-logo {
		height: 58px;
		padding: 0 14px;
		display: flex;
		align-items: center;
		gap: 10px;
		border-bottom: 1px solid rgba(255, 255, 255, 0.07);
		flex-shrink: 0;
	}

	.app-sidebar-logo-mark {
		width: 34px;
		height: 34px;
		border-radius: 10px;
		background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
		display: flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
		box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
	}

	.app-sidebar-logo-text {
		font-size: 13px;
		font-weight: 800;
		letter-spacing: 0.03em;
		color: #f8fafc;
		white-space: nowrap;
		transition: opacity 0.16s ease, width 0.22s ease;
	}

	.sidebar-collapsed .app-sidebar-logo-text {
		opacity: 0;
		width: 0;
		overflow: hidden;
		pointer-events: none;
	}

	/* ── Sidebar: nav area ── */
	.app-sidebar-nav {
		flex: 1;
		padding: 10px 8px;
		display: flex;
		flex-direction: column;
		gap: 2px;
		overflow-y: auto;
		overflow-x: hidden;
	}

	.app-sidebar-nav::-webkit-scrollbar { width: 0; }

	/* ── Sidebar: item ── */
	.app-sidebar-item {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 9px 12px;
		border-radius: 9px;
		color: #94a3b8;
		font-size: 13px;
		font-weight: 600;
		text-decoration: none;
		white-space: nowrap;
		transition: background 0.16s, color 0.16s, transform 0.16s;
		position: relative;
		cursor: pointer;
		border: none;
		background: transparent;
		width: 100%;
		text-align: left;
		animation: appSidebarItemIn 0.32s ease-out both;
	}

	.app-sidebar-item:nth-child(1) { animation-delay: 0.02s; }
	.app-sidebar-item:nth-child(2) { animation-delay: 0.04s; }
	.app-sidebar-item:nth-child(3) { animation-delay: 0.06s; }
	.app-sidebar-item:nth-child(4) { animation-delay: 0.08s; }
	.app-sidebar-item:nth-child(5) { animation-delay: 0.1s; }
	.app-sidebar-item:nth-child(6) { animation-delay: 0.12s; }

	.app-sidebar-item:hover {
		background: rgba(255, 255, 255, 0.075);
		color: #e2e8f0;
		transform: translateX(1px);
	}

	.app-sidebar-item.is-active {
		background: rgba(59, 130, 246, 0.16);
		color: #93c5fd;
		box-shadow: inset 2px 0 0 #60a5fa;
	}

	.app-sidebar-item.is-active::before {
		content: '';
		position: absolute;
		left: 0;
		top: 8px;
		bottom: 8px;
		width: 2px;
		background: #60a5fa;
		border-radius: 2px;
		opacity: 0.9;
	}

	.app-sidebar-item.is-active .app-sidebar-icon {
		color: #60a5fa;
	}

	/* ── Sidebar: icon / label ── */
	.app-sidebar-icon {
		width: 18px;
		height: 18px;
		flex-shrink: 0;
	}

	.app-sidebar-label {
		flex: 1;
		opacity: 1;
		overflow: hidden;
		transition: opacity 0.16s ease;
	}

	.sidebar-collapsed .app-sidebar-label {
		opacity: 0;
		width: 0;
		pointer-events: none;
	}

	/* Tooltip on hover when collapsed */

	.sidebar-collapsed .app-sidebar-item {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		margin: 0 auto;
		border-radius: 12px;
	}

	.sidebar-collapsed .app-sidebar-item .app-sidebar-icon {
		display: block;
		margin-left: 6px;
		width: 18px;
		height: 18px;
	}

	.sidebar-collapsed .app-sidebar-item .app-sidebar-chevron,
	.sidebar-collapsed .app-sidebar-item svg.rotate-90 {
		display: none;
	}

	.sidebar-collapsed .app-sidebar-sep {
		margin: 8px 12px;
	}

	.sidebar-collapsed .app-sidebar-nav {
		padding-inline: 8px;
	}

	.sidebar-collapsed .app-sidebar-item.is-active::before {
		display: none;
	}

	.sidebar-collapsed .app-sidebar-item::after {
		content: attr(data-label);
		position: absolute;
		left: 68px;
		top: 50%;
		transform: translateY(-50%);
		background: #1e293b;
		color: #f1f5f9;
		font-size: 12px;
		font-weight: 600;
		padding: 5px 12px;
		border-radius: 7px;
		white-space: nowrap;
		box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
		z-index: 99;
		border: 1px solid rgba(255, 255, 255, 0.1);
		pointer-events: none;
		opacity: 0;
		transition: opacity 0.12s ease;
	}

	.sidebar-collapsed .app-sidebar-item:hover::after {
		opacity: 1;
	}

	/* ── Sidebar: separator ── */
	.app-sidebar-sep {
		height: 1px;
		background: rgba(255, 255, 255, 0.07);
		margin: 6px 4px;
		flex-shrink: 0;
	}

	/* ── Sidebar: bottom user area ── */
	.app-sidebar-bottom {
		padding: 8px;
		border-top: 1px solid rgba(255, 255, 255, 0.07);
		flex-shrink: 0;
		display: flex;
		flex-direction: column;
		gap: 2px;
	}

	/* ── Mobile backdrop ── */
	.app-mob-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 39;
		backdrop-filter: blur(2px);
	}

	/* ── Main wrapper (beside sidebar) ── */
	.app-main-wrap {
		flex: 1;
		min-width: 0;
		margin-left: 218px;
		min-height: 100vh;
		display: flex;
		flex-direction: column;
		transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
		background: #f1f5f9;
	}

	.sidebar-collapsed .app-main-wrap {
		margin-left: 62px;
	}

	@media (max-width: 767px) {
		.app-main-wrap {
			margin-left: 0;
		}

		.app-topbar {
			height: 56px;
			padding: 0 14px;
		}

		.app-page-header .app-shell {
			padding-top: 0.7rem;
			padding-bottom: 0.7rem;
		}
	}

	/* ── Topbar ── */
	.app-topbar {
		height: 62px;
		background: #ffffff;
		border-bottom: 1px solid #e2e8f0;
		display: flex;
		align-items: center;
		padding: 0 18px;
		gap: 12px;
		flex-shrink: 0;
		position: sticky;
		top: 0;
		z-index: 30;
		box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
	}

	.app-sidebar-toggle {
		width: 34px;
		height: 34px;
		border-radius: 8px;
		border: 1px solid #e2e8f0;
		background: #f8fafc;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		color: #64748b;
		flex-shrink: 0;
		cursor: pointer;
		transition: background 0.14s, border-color 0.14s, color 0.14s;
	}

	.app-sidebar-toggle:hover {
		background: #f1f5f9;
		border-color: #cbd5e1;
		color: #1e293b;
	}

	/* ── Topbar breadcrumb ── */
	.app-topbar-breadcrumb {
		font-size: 15px;
		font-weight: 700;
		color: #1e293b;
		letter-spacing: 0;
	}

	/* ── Page header below topbar ── */
	.app-page-header {
		background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
		border-bottom: 1px solid #e2e8f0;
	}

	.app-page-header .app-title {
		font-size: clamp(1.25rem, 1.6vw, 1.72rem);
		line-height: 1.15;
	}

	.app-page-header p {
		margin: 0;
	}

	.app-page-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.9rem;
	}

	.app-page-kicker {
		font-size: 10px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.18em;
		color: #64748b;
	}

	.app-page-note {
		font-size: 12px;
		color: #64748b;
		margin-top: 0.28rem;
	}

	/* ── Topbar user button ── */
	.app-topbar-user-btn {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		border-radius: 10px;
		border: 1px solid #e2e8f0;
		background: #f8fafc;
		padding: 5px 10px 5px 5px;
		cursor: pointer;
		transition: background 0.14s, border-color 0.14s;
	}

	.app-topbar-user-btn:hover {
		background: #f1f5f9;
		border-color: #cbd5e1;
	}

	.app-topbar-user-btn:focus-visible,
	.app-theme-toggle:focus-visible,
	.app-sidebar-toggle:focus-visible,
	.app-sidebar-item:focus-visible {
		outline: 2px solid #60a5fa;
		outline-offset: 2px;
	}

	.app-theme-toggle {
		height: 34px;
		min-width: 34px;
		padding: 0 10px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		border-radius: 8px;
		border: 1px solid #e2e8f0;
		background: #f8fafc;
		color: #64748b;
		font-size: 12px;
		font-weight: 700;
		cursor: pointer;
		transition: background 0.14s, border-color 0.14s, color 0.14s;
	}

	.app-theme-toggle:hover {
		background: #f1f5f9;
		border-color: #cbd5e1;
		color: #1e293b;
	}

	.app-topbar-avatar {
		width: 28px;
		height: 28px;
		border-radius: 50%;
		background: linear-gradient(135deg, #1e3a8a, #2563eb);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 10px;
		font-weight: 800;
		color: #fff;
		flex-shrink: 0;
		letter-spacing: 0.03em;
	}

	.app-topbar-name {
		font-size: 13px;
		font-weight: 600;
		color: #374151;
		max-width: 140px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* ── Page content ── */
	.app-content {
		flex: 1;
		padding: 0 0 60px;
	}

	/* ── Shell (max-width container inside content) ── */
	.app-shell {
		@apply mx-auto w-full max-w-[1360px] px-4 sm:px-6;
	}

	/* ── Bottom nav (mobile) ── */
	.app-bottom-nav {
		@apply fixed bottom-3 left-1/2 z-50 grid w-[calc(100%-1.25rem)] max-w-md -translate-x-1/2 grid-cols-4 gap-1 rounded-[1.4rem] border border-white/70 bg-white/90 p-1.5;
		backdrop-filter: blur(14px);
		box-shadow: 0 12px 30px rgba(20, 36, 70, 0.18);
	}

	.app-bottom-link {
		@apply inline-flex flex-col items-center justify-center gap-1 rounded-xl px-2 py-2 text-[10px] font-semibold uppercase tracking-[0.09em] text-slate-500;
	}

	.app-bottom-icon {
		@apply h-4 w-4;
	}

	.app-bottom-link.is-active {
		@apply text-white;
		background: linear-gradient(135deg, #10284e 0%, #0b4f9e 100%);
		box-shadow: 0 10px 18px rgba(14, 47, 93, 0.32);
	}

	.app-title {
		@apply text-xl md:text-2xl font-semibold text-slate-900;
		letter-spacing: -0.02em;
	}

	.app-card {
		@apply rounded-[1.65rem] border border-slate-200 bg-white p-4 shadow-sm md:p-6 overflow-hidden;
		box-shadow: 0 2px 12px rgba(17, 37, 71, 0.06);
	}

	.app-stat-card {
		@apply rounded-2xl border border-slate-300 bg-white p-4 min-w-0 overflow-hidden;
		background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.95));
	}

	.app-report-summary-grid .app-stat-card {
		position: relative;
		border-width: 1px;
		box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
	}

	.app-report-summary-grid .app-stat-card:nth-child(1) {
		border-color: #bfdbfe;
		background-image: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
	}

	.app-report-summary-grid .app-stat-card:nth-child(2) {
		border-color: #a7f3d0;
		background-image: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
	}

	.app-report-summary-grid .app-stat-card:nth-child(3) {
		border-color: #fde68a;
		background-image: linear-gradient(160deg, #fffbeb 0%, #fef3c7 100%);
	}

	.app-report-summary-grid .app-stat-card:nth-child(1) .app-stat-label,
	.app-report-summary-grid .app-stat-card:nth-child(1) .app-stat-value {
		color: #1e3a8a;
	}

	.app-report-summary-grid .app-stat-card:nth-child(2) .app-stat-label,
	.app-report-summary-grid .app-stat-card:nth-child(2) .app-stat-value {
		color: #065f46;
	}

	.app-report-summary-grid .app-stat-card:nth-child(3) .app-stat-label,
	.app-report-summary-grid .app-stat-card:nth-child(3) .app-stat-value {
		color: #92400e;
	}

	.app-stat-label {
		@apply text-[10px] uppercase tracking-[0.13em] text-slate-500 truncate;
	}

	.app-stat-value {
		@apply mt-1 text-2xl font-bold text-slate-900;
	}

	.app-stat-value-sm {
		@apply mt-1 text-base font-semibold text-slate-900 break-all leading-tight;
	}

	.app-hero {
		@apply rounded-[1.9rem] p-4 text-white shadow-lg md:p-6;
		background: linear-gradient(136deg, #0d2b57 0%, #0f5cb8 46%, #1f8bca 100%);
		box-shadow: 0 18px 36px rgba(12, 56, 117, 0.33);
	}

	.app-hero-label {
		@apply text-xs uppercase tracking-[0.18em] text-white/80;
	}

	.app-hero-value {
		@apply mt-1 text-3xl font-extrabold leading-none md:text-4xl;
		letter-spacing: -0.03em;
	}

	.app-hero-sub {
		@apply text-xs text-white/80;
	}

	.app-hero-tile {
		@apply rounded-2xl p-4;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	}

	.app-hero-tile-sales {
		background: #ffe0f9;
		color: #a33091;
	}

	.app-hero-tile-orders {
		background: #d1fae5;
		color: #065f46;
	}

	.app-hero-tile-aov {
		background: #ede9fe;
		color: #4c1d95;
	}

	.app-hero-tile-time {
		background: #ffedd5;
		color: #7c2d12;
	}

	.app-hero-tile-card {
		background: #ffe4e6;
		color: #9f1239;
	}

	.app-hero-tile-cash {
		background: #dcfce7;
		color: #14532d;
	}

	.app-tile-label {
		@apply text-[10px] font-semibold uppercase tracking-[0.14em] opacity-70;
	}

	.app-tile-head {
		@apply flex items-center gap-2;
	}

	.app-tile-icon {
		@apply inline-flex h-9 w-9 items-center justify-center rounded-xl;
		background: rgba(255, 255, 255, 0.45);
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
	}

	.app-tile-icon svg {
		@apply h-5 w-5;
	}

	.app-tile-value {
		@apply mt-1 text-2xl font-extrabold leading-tight;
		letter-spacing: -0.02em;
	}

	.app-tile-main-row {
		@apply mt-1 flex items-end justify-between gap-3;
	}

	.app-tile-split {
		@apply text-sm font-bold;
		min-width: 12.5rem;
		display: grid;
		row-gap: 0.7rem;
	}

	.app-tile-split-line {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: baseline;
		column-gap: 2.4rem;
		white-space: nowrap;
		line-height: 1;
	}

	.app-tile-split-key {
		@apply opacity-90;
		text-align: left;
	}

	.app-tile-split-value {
		@apply text-right font-extrabold tabular-nums;
		min-width: 6.4rem;
	}

	.app-kpi-chip {
		@apply rounded-2xl border border-slate-200/80 bg-white p-3 shadow-sm;
		background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.95));
	}

	.app-kpi-chip-green {
		@apply border-emerald-100 bg-emerald-50/80;
	}

	.app-kpi-chip-amber {
		@apply border-amber-100 bg-amber-50/80;
	}

	.app-kpi-chip-blue {
		@apply border-blue-100 bg-blue-50/80;
	}

	.app-branch-spotlight {
		@apply rounded-2xl border border-slate-200/90 bg-white p-3;
		background-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(246, 250, 255, 0.92));
	}

	.app-branch-title-row {
		@apply mb-2 inline-flex items-center gap-2 rounded-full border border-amber-100 bg-amber-50 px-2.5 py-1;
	}

	.app-branch-icon {
		@apply inline-flex h-5 w-5 items-center justify-center rounded-full bg-amber-500 text-white;
	}

	.app-branch-icon svg {
		@apply h-3 w-3;
	}

	.app-branch-icon-text {
		@apply text-[10px] font-bold uppercase tracking-[0.1em] text-amber-700;
	}

	.app-branch-kicker {
		@apply text-[10px] font-semibold uppercase tracking-[0.14em] text-slate-500;
	}

	.app-branch-name {
		@apply mt-1 truncate text-xl font-extrabold text-slate-900;
		letter-spacing: -0.02em;
	}

	.app-branch-pill {
		@apply inline-flex shrink-0 items-center rounded-full border border-blue-100 bg-blue-50 px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.08em] text-blue-700;
	}

	.app-branch-metrics {
		@apply mt-3 grid grid-cols-1 gap-2;
	}

	.app-branch-metric {
		@apply rounded-xl border border-slate-200 bg-slate-50/75 p-2.5;
	}

	.app-branch-metric-primary {
		@apply border-indigo-100 bg-indigo-50/70;
	}

	.app-branch-metric-label {
		@apply text-[10px] font-semibold uppercase tracking-[0.11em] text-slate-500;
	}

	.app-branch-metric-value {
		@apply mt-1 text-lg font-extrabold leading-tight text-slate-900;
		letter-spacing: -0.02em;
	}

	.app-fixed-total-wrap {
		@apply rounded-2xl border border-slate-200/90 bg-slate-50/70 p-2 h-full flex flex-col;
	}

	.app-fixed-total-body {
		@apply mt-1 flex-1 flex flex-col justify-between gap-1;
	}

	.app-fixed-total-head {
		@apply grid grid-cols-[1.45fr_0.65fr_1.1fr] items-center gap-2 px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.12em] text-slate-500;
	}

	.app-fixed-total-row {
		@apply grid grid-cols-[1.45fr_0.65fr_1.1fr] items-center gap-2 rounded-xl border border-slate-200 bg-white px-2 py-2.5;
	}

	.app-fixed-total-name {
		@apply truncate text-xs font-semibold text-slate-700;
	}

	.app-fixed-total-count {
		@apply text-right text-xs font-bold text-slate-900;
	}

	.app-fixed-total-value {
		@apply text-right text-xs font-bold text-blue-900;
	}

	.app-seller-block {
		@apply rounded-2xl border border-slate-200/80 bg-white p-3;
		background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.95));
	}

	.app-seller-row {
		@apply flex items-center gap-2 rounded-xl border border-slate-100 bg-slate-50/70 px-2.5 py-2 text-xs text-slate-700;
	}

	.app-seller-rank {
		@apply inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-full bg-slate-200 px-1 text-[10px] font-bold text-slate-700;
	}

	.app-seller-name {
		@apply flex-1 truncate font-medium text-slate-700;
	}

	.app-seller-qty {
		@apply rounded-full bg-slate-900 px-2 py-0.5 text-[10px] font-bold text-white;
	}

	.app-seller-empty {
		@apply rounded-xl border border-dashed border-slate-200 bg-slate-50 px-3 py-2 text-xs text-slate-500;
	}

	.app-th {
		@apply px-3 py-3 text-left text-[11px] font-semibold uppercase tracking-wide text-slate-500;
	}

	.app-td {
		@apply px-3 py-3 text-sm text-slate-700;
	}

	.app-empty {
		@apply px-3 py-8 text-center text-sm text-slate-500;
	}

	.app-pill {
		@apply inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium;
	}

	.app-pill-ok {
		@apply bg-emerald-50 text-emerald-700;
	}

	.app-pill-bad {
		@apply bg-rose-50 text-rose-700;
	}

	.app-pill-muted {
		@apply bg-slate-100 text-slate-600;
	}

	.app-btn-primary {
		@apply inline-flex items-center justify-center rounded-xl px-4 py-2 text-xs font-semibold uppercase tracking-wide text-white;
		background: linear-gradient(135deg, #122d59 0%, #0a67cd 100%);
		box-shadow: 0 10px 20px rgba(10, 58, 121, 0.25);
	}

	.app-btn-muted {
		@apply inline-flex items-center rounded-xl border border-slate-300 bg-white/75 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-slate-700 hover:bg-slate-100;
	}

	.app-btn-danger {
		@apply inline-flex items-center rounded-xl bg-rose-600 px-3 py-1.5 text-xs font-semibold uppercase tracking-wide text-white hover:bg-rose-700;
	}

	.app-alert {
		@apply rounded-xl border border-emerald-200 bg-emerald-50 p-3 text-sm text-emerald-700;
	}

	.app-section-title {
		@apply text-sm font-bold uppercase tracking-[0.16em] text-slate-700;
	}

	.app-section-title.is-blue {
		color: #1d4ed8;
	}

	.app-section-title.is-emerald {
		color: #047857;
	}

	.app-section-title.is-violet {
		color: #6d28d9;
	}

	.app-section-title.is-amber {
		color: #b45309;
	}

	.app-section-title.is-rose {
		color: #be123c;
	}

	.app-section-title.is-cyan {
		color: #0e7490;
	}

	.app-section-title.is-indigo {
		color: #4338ca;
	}

	.app-chart-wrap {
		@apply rounded-2xl border border-slate-200/85 bg-white p-3 shadow-sm;
		background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 255, 0.98));
	}

	.app-chart-canvas {
		@apply relative;
		height: 220px;
	}

	@media (max-width: 640px) {
		.app-chart-canvas {
			height: 210px;
		}
	}

	.app-table-wrap {
		@apply overflow-hidden rounded-2xl border border-slate-200 bg-white;
	}

	.app-table {
		@apply w-full border-collapse;
	}

	.app-table thead th {
		@apply bg-slate-50 px-4 py-3 text-left text-[11px] font-semibold uppercase tracking-[0.12em] text-slate-500;
	}

	.app-table tbody td {
		@apply border-t border-slate-100 px-4 py-3 text-sm text-slate-700;
	}

	.app-table tbody tr:hover {
		@apply bg-slate-50/70;
	}

	.app-kpi-label {
		@apply text-[10px] font-semibold uppercase tracking-[0.16em] text-slate-500;
	}

	.app-kpi-value {
		@apply mt-1 text-2xl font-extrabold leading-tight text-slate-900 md:text-3xl;
		letter-spacing: -0.02em;
	}

	.app-filter-grid {
		@apply grid grid-cols-1 gap-3 md:grid-cols-4;
	}

	.app-report-pill-list {
		@apply flex gap-2 overflow-x-auto pb-2;
	}

	.app-report-pill {
		@apply whitespace-nowrap rounded-full border border-slate-300/85 bg-white px-3 py-1.5 text-xs font-semibold text-slate-600;
	}

	.app-report-pill.is-active {
		@apply border-transparent text-white;
		background: linear-gradient(135deg, #112b54 0%, #0a67cb 100%);
	}

	.app-click-row {
		cursor: pointer;
	}

	.app-device-grid {
		@apply grid gap-3 md:grid-cols-2 xl:grid-cols-4;
	}

	.app-device-card {
		@apply rounded-2xl border border-slate-200 bg-slate-50/70 p-4;
	}

	.app-device-card-head {
		@apply flex items-start justify-between gap-3;
	}

	.app-device-card-name {
		@apply text-sm font-bold text-slate-900;
	}

	.app-device-card-code {
		@apply mt-1 text-[10px] uppercase tracking-[0.12em] text-slate-500;
	}

	.app-device-card-stats {
		@apply mt-4 space-y-2;
	}

	.app-device-stat {
		@apply flex items-center justify-between border-t border-slate-200 pt-2 text-xs text-slate-600;
	}

	.app-device-stat strong {
		@apply text-slate-900;
	}

	.app-device-total {
		@apply mt-4 text-right text-2xl font-extrabold text-slate-900;
		letter-spacing: -0.02em;
	}

	.app-device-badge {
		@apply inline-flex items-center rounded-full border px-2.5 py-1 text-[10px] font-bold uppercase tracking-[0.08em];
	}

	.app-device-badge-till {
		@apply border-blue-300 bg-blue-50 text-blue-700;
	}

	.app-device-badge-kiosk {
		@apply border-amber-300 bg-amber-50 text-amber-700;
	}

	.app-device-badge-other {
		@apply border-slate-300 bg-slate-100 text-slate-700;
	}

	.live-board-wrap {
		display: grid;
		grid-template-columns: repeat(3, minmax(240px, 1fr));
		gap: 0.85rem;
		overflow-x: auto;
		max-width: 100%;
		padding-bottom: 0.4rem;
	}

	.app-shell-live-board {
		max-width: 100%;
	}
	@media (min-width: 1024px) {
		.live-board-wrap {
			grid-template-columns: repeat(3, minmax(0, 1fr));
			gap: 1.5rem;
			overflow-x: visible;
		}
	}

	.live-board-col {
		border-radius: 1rem;
		border: 1px solid #dbe5f1;
		background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
		min-height: 380px;
		display: flex;
		flex-direction: column;
	}

	.live-board-col.is-new { border-top: 3px solid #64748b; }
	.live-board-col.is-preparing { border-top: 3px solid #f59e0b; }
	.live-board-col.is-ready { border-top: 3px solid #22c55e; }
	.live-board-col.is-completed { border-top: 3px solid #0ea5e9; }
	.live-board-col.is-cancelled { border-top: 3px solid #ef4444; }
	.live-board-col.is-other { border-top: 3px solid #94a3b8; }

	.live-board-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0.65rem 0.75rem;
		border-bottom: 1px solid #e2e8f0;
	}

	.live-board-title {
		font-size: 12px;
		font-weight: 800;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: #334155;
	}

	.live-board-count {
		min-width: 1.7rem;
		height: 1.7rem;
		padding: 0 0.45rem;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		border-radius: 999px;
		background: #e2e8f0;
		font-size: 11px;
		font-weight: 700;
		color: #0f172a;
	}

	.live-board-list {
		padding: 0.5rem;
		display: flex;
		flex-direction: column;
		gap: 0.45rem;
		overflow-y: auto;
		max-height: min(72vh, 780px);
	}

	.live-card {
		border-radius: 0.75rem;
		border: 1px solid #e2e8f0;
		background: #fff;
		padding: 0.55rem 0.62rem;
		box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
	}

	.live-card-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.5rem;
	}

	.live-card-invoice {
		font-size: 12px;
		font-weight: 800;
		color: #0f172a;
	}

	.live-card-age {
		font-size: 11px;
		font-weight: 700;
		color: #b45309;
	}

	.live-card-branch {
		font-size: 11px;
		font-weight: 700;
		color: #1e293b;
		margin-top: 0.2rem;
	}

	.live-card-meta {
		font-size: 11px;
		color: #64748b;
		margin-top: 0.12rem;
	}

	.live-card-status {
		font-size: 10px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: #334155;
	}

	.live-card-total {
		font-size: 12px;
		font-weight: 800;
		color: #0f172a;
	}

	.live-empty {
		border: 1px dashed #cbd5e1;
		background: #f8fafc;
		color: #64748b;
		border-radius: 0.7rem;
		font-size: 12px;
		padding: 0.6rem;
		text-align: center;
	}

	.app-card,
	.app-chart-wrap,
	.app-stat-card,
	.app-kpi-chip {
		animation: appCardIn 0.45s ease-out both;
	}

	@media (min-width: 1024px) {
		.app-main-content {
			@apply pt-2;
		}

		.app-stat-value {
			@apply text-[1.85rem];
		}
	}

	@media (max-width: 640px) {
		.app-card {
			@apply rounded-[1.35rem] p-4;
		}

		.app-hero {
			@apply rounded-[1.5rem];
		}

		.app-title {
			@apply text-lg;
		}

		.app-section-title {
			@apply text-xs;
		}

		.live-board-wrap {
			grid-template-columns: repeat(6, minmax(240px, 1fr));
		}
	}

	@keyframes appCardIn {
		0% {
			opacity: 0;
			transform: translateY(14px) scale(0.985);
		}
		100% {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}

	@keyframes appSidebarItemIn {
		0% {
			opacity: 0;
			transform: translateX(-4px);
		}
		100% {
			opacity: 1;
			transform: translateX(0);
		}
	}

	@media (prefers-reduced-motion: reduce) {
		.app-sidebar,
		.app-main-wrap,
		.app-sidebar-item,
		.app-topbar,
		.app-mob-backdrop {
			transition: none !important;
			animation: none !important;
		}
	}

	.theme-dark body,
	.theme-dark .app-body {
		background: #0b1220;
		color: #e2e8f0;
	}

	.theme-dark .app-main-wrap {
		background: #0f172a;
	}

	.theme-dark .app-topbar {
		background: #0f172a;
		border-bottom-color: #1f2937;
		box-shadow: 0 1px 6px rgba(2, 6, 23, 0.4);
	}

	.theme-dark .app-page-header {
		background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
		border-bottom-color: #1f2937;
	}

	.theme-dark .app-topbar-breadcrumb,
	.theme-dark .app-page-kicker,
	.theme-dark .app-page-note,
	.theme-dark .app-topbar-name,
	.theme-dark .app-title {
		color: #e5e7eb;
	}

	.theme-dark .app-sidebar-toggle,
	.theme-dark .app-theme-toggle,
	.theme-dark .app-topbar-user-btn {
		background: #111827;
		border-color: #334155;
		color: #cbd5e1;
	}

	.theme-dark .app-sidebar-toggle:hover,
	.theme-dark .app-theme-toggle:hover,
	.theme-dark .app-topbar-user-btn:hover {
		background: #1f2937;
		border-color: #475569;
		color: #e5e7eb;
	}

	.theme-dark .app-card,
	.theme-dark .app-chart-wrap,
	.theme-dark .app-stat-card,
	.theme-dark .app-kpi-chip,
	.theme-dark .app-table-wrap,
	.theme-dark .app-report-table,
	.theme-dark .app-shell-live-board {
		background-color: #111827;
		border-color: #334155;
		color: #d1d5db;
	}

	.theme-dark .app-th {
		background-color: #0f172a;
		border-color: #334155;
		color: #94a3b8;
	}

	.theme-dark .app-td,
	.theme-dark .app-empty,
	.theme-dark .app-live-empty {
		border-color: #334155;
		color: #cbd5e1;
	}

	.theme-dark .app-btn-muted {
		background: #1f2937;
		border-color: #475569;
		color: #e5e7eb;
	}

	.theme-dark .app-btn-muted:hover {
		background: #334155;
	}

	.theme-dark .bg-white,
	.theme-dark .bg-white\/75,
	.theme-dark .bg-white\/90 {
		background-color: #111827 !important;
	}

	.theme-dark .bg-slate-50,
	.theme-dark .bg-slate-50\/70,
	.theme-dark .bg-slate-50\/75,
	.theme-dark .bg-slate-50\/80,
	.theme-dark .bg-slate-100 {
		background-color: #0f172a !important;
	}

	.theme-dark .border-slate-100,
	.theme-dark .border-slate-200,
	.theme-dark .border-slate-300,
	.theme-dark .border-gray-300 {
		border-color: #334155 !important;
	}

	.theme-dark .text-slate-500,
	.theme-dark .text-slate-600,
	.theme-dark .text-slate-700,
	.theme-dark .text-slate-800,
	.theme-dark .text-gray-700 {
		color: #cbd5e1 !important;
	}

	.theme-dark .text-slate-900,
	.theme-dark .text-gray-900 {
		color: #f1f5f9 !important;
	}

	.theme-dark input,
	.theme-dark select,
	.theme-dark textarea {
		background-color: #0f172a !important;
		border-color: #334155 !important;
		color: #e2e8f0 !important;
	}

	.theme-dark input::placeholder,
	.theme-dark textarea::placeholder {
		color: #94a3b8 !important;
	}

	.theme-dark select option {
		background: #0f172a;
		color: #e2e8f0;
	}

	.theme-dark .app-hero-tile,
	.theme-dark .app-stat-card,
	.theme-dark .app-chart-wrap,
	.theme-dark .app-kpi-chip,
	.theme-dark .app-branch-spotlight,
	.theme-dark .app-fixed-total-wrap,
	.theme-dark .app-fixed-total-row,
	.theme-dark .app-seller-block,
	.theme-dark .app-seller-row,
	.theme-dark .app-branch-metric {
		background-image: none !important;
	}

	.theme-dark .app-stat-card {
		background-color: #111827 !important;
		border-color: #334155 !important;
	}

	.theme-dark .app-stat-label {
		color: #94a3b8 !important;
	}

	.theme-dark .app-stat-value,
	.theme-dark .app-stat-value-sm {
		color: #f1f5f9 !important;
	}

	.theme-dark .app-hero-tile-sales {
		background: #3b1f36 !important;
		color: #fbcfe8 !important;
	}

	.theme-dark .app-hero-tile-orders {
		background: #15352b !important;
		color: #bbf7d0 !important;
	}

	.theme-dark .app-hero-tile-aov {
		background: #282146 !important;
		color: #ddd6fe !important;
	}

	.theme-dark .app-hero-tile-time {
		background: #3d2a17 !important;
		color: #fed7aa !important;
	}

	.theme-dark .app-hero-tile-card {
		background: #3f1f2a !important;
		color: #fecdd3 !important;
	}

	.theme-dark .app-hero-tile-cash {
		background: #183326 !important;
		color: #bbf7d0 !important;
	}

	.theme-dark .app-tile-icon {
		background: rgba(15, 23, 42, 0.45);
		box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.3);
	}

	.theme-dark .app-kpi-chip,
	.theme-dark .app-branch-spotlight,
	.theme-dark .app-fixed-total-wrap,
	.theme-dark .app-fixed-total-row,
	.theme-dark .app-seller-block,
	.theme-dark .app-seller-row,
	.theme-dark .app-branch-metric {
		background-color: #111827 !important;
		border-color: #334155 !important;
		color: #d1d5db !important;
	}

	.theme-dark .app-kpi-chip-green {
		background-color: rgba(16, 185, 129, 0.16) !important;
		border-color: rgba(16, 185, 129, 0.35) !important;
	}

	.theme-dark .app-kpi-chip-amber {
		background-color: rgba(245, 158, 11, 0.16) !important;
		border-color: rgba(245, 158, 11, 0.35) !important;
	}

	.theme-dark .app-kpi-chip-blue {
		background-color: rgba(59, 130, 246, 0.16) !important;
		border-color: rgba(59, 130, 246, 0.35) !important;
	}

	.theme-dark .app-pill-ok {
		background-color: rgba(16, 185, 129, 0.22) !important;
		color: #6ee7b7 !important;
	}

	.theme-dark .app-pill-bad {
		background-color: rgba(244, 63, 94, 0.22) !important;
		color: #fda4af !important;
	}

	.theme-dark .app-pill-muted {
		background-color: rgba(100, 116, 139, 0.25) !important;
		color: #cbd5e1 !important;
	}

	.theme-dark .app-device-badge-till {
		background-color: rgba(59, 130, 246, 0.2) !important;
		border-color: rgba(96, 165, 250, 0.45) !important;
		color: #93c5fd !important;
	}

	.theme-dark .app-device-badge-kiosk {
		background-color: rgba(245, 158, 11, 0.2) !important;
		border-color: rgba(251, 191, 36, 0.45) !important;
		color: #fcd34d !important;
	}

	.theme-dark .app-device-badge-other {
		background-color: rgba(71, 85, 105, 0.35) !important;
		border-color: rgba(148, 163, 184, 0.45) !important;
		color: #cbd5e1 !important;
	}

	.theme-dark .live-board-col {
		background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
		border-color: #334155 !important;
	}

	.theme-dark .live-board-head {
		border-bottom-color: #334155 !important;
	}

	.theme-dark .live-board-title {
		color: #94a3b8 !important;
	}

	.theme-dark .live-board-count {
		background: #1f2937 !important;
		color: #e2e8f0 !important;
	}

	.theme-dark .live-card {
		background: #0f172a !important;
		border-color: #334155 !important;
		box-shadow: 0 2px 10px rgba(2, 6, 23, 0.45) !important;
	}

	.theme-dark .live-card-invoice,
	.theme-dark .live-card-branch,
	.theme-dark .live-card-total {
		color: #f1f5f9 !important;
	}

	.theme-dark .live-card-meta,
	.theme-dark .live-card-status {
		color: #94a3b8 !important;
	}

	.theme-dark .live-card-age {
		color: #fbbf24 !important;
	}

	.theme-dark .live-empty {
		background: #0f172a !important;
		border-color: #334155 !important;
		color: #94a3b8 !important;
	}

	.theme-dark .hover\:bg-gray-100:hover,
	.theme-dark .hover\:bg-slate-100:hover {
		background-color: #1f2937 !important;
	}

	.theme-dark .ring-black {
		--tw-ring-color: rgb(71 85 105 / 0.7) !important;
	}
}
