/* Sri Senthur Furniture - admin portal
   Brand palette from the client logo: mahogany red capsule + gold Vel accent. */
:root {
	--app-primary: #a81818;
	--app-primary-hover: #8b1515;
	--app-primary-soft: #f8e8e8;
	--app-accent: #f8c058;
	--app-accent-strong: #e0a83a;
	--app-sidebar-bg: transparent;
	--app-sidebar-text: #5e6474;
	--app-sidebar-muted: #9aa0ae;
	--app-sidebar-active: #a81818;
	--app-sidebar-hover: #f8e8e8;
	--app-canvas: #f3ecec;
	--app-body-bg: #f3ecec;
	--app-surface: #ffffff;
	--app-ink: #1a1c23;
	--app-muted: #8b90a0;
	--app-border: #eadfdf;
	--app-shadow: 0 10px 30px rgba(168, 24, 24, .08);
	--app-sidebar-width: 264px;

	--bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--bs-body-font-size: 0.9375rem;
	--bs-body-color: var(--app-ink);
	--bs-body-bg: var(--app-body-bg);
	--bs-secondary-color: var(--app-muted);
	--bs-link-color: var(--app-primary);
	--bs-link-color-rgb: 168, 24, 24;
	--bs-link-hover-color: var(--app-primary-hover);
	--bs-link-hover-color-rgb: 139, 21, 21;
	--bs-primary: var(--app-primary);
	--bs-primary-rgb: 168, 24, 24;
	--bs-border-color: var(--app-border);
	--bs-focus-ring-color: rgba(168, 24, 24, .22);
}

body { min-height: 100vh; color: var(--app-ink); background: var(--app-canvas); }
body.bg-light { background-color: var(--app-canvas) !important; }

.skip-link {
	position: absolute; top: .5rem; left: .5rem; z-index: 2000;
	background: #fff; padding: .5rem 1rem; border-radius: .375rem;
}

.btn-primary {
	--bs-btn-bg: var(--app-primary);
	--bs-btn-border-color: var(--app-primary);
	--bs-btn-hover-bg: var(--app-primary-hover);
	--bs-btn-hover-border-color: var(--app-primary-hover);
	--bs-btn-active-bg: var(--app-primary-hover);
	--bs-btn-active-border-color: var(--app-primary-hover);
	--bs-btn-disabled-bg: var(--app-primary);
	--bs-btn-disabled-border-color: var(--app-primary);
	--bs-btn-focus-shadow-rgb: 168, 24, 24;
}
.btn-outline-primary {
	--bs-btn-color: var(--app-primary);
	--bs-btn-border-color: #d9b8b8;
	--bs-btn-hover-bg: var(--app-primary);
	--bs-btn-hover-border-color: var(--app-primary);
	--bs-btn-hover-color: #fff;
	--bs-btn-active-bg: var(--app-primary-hover);
	--bs-btn-active-border-color: var(--app-primary-hover);
	--bs-btn-focus-shadow-rgb: 168, 24, 24;
}
.form-control, .form-select {
	border-color: #e3e6ef;
	border-radius: .7rem;
	background-color: #f7f8fb;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
	border-color: #b7bdcc;
	background-color: #fff;
	box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
}
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.text-primary { color: var(--app-primary) !important; }
.bg-primary { background-color: var(--app-primary) !important; }
.bg-primary-soft { background: var(--app-primary-soft); }
.form-label { font-weight: 500; margin-bottom: .35rem; }
.form-label .req { color: #d92d20; margin-left: 2px; }
.form-text { font-size: .8125rem; color: var(--app-muted); }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; padding: 14px; gap: 6px; background: var(--app-canvas); }
.app-main {
	flex: 1; min-width: 0; display: flex; flex-direction: column;
	background: var(--app-surface);
	border-radius: 28px;
	box-shadow: var(--app-shadow);
	overflow: hidden;
	min-height: calc(100vh - 28px);
}
.app-content { flex: 1; padding: 1.5rem 1.75rem 2rem; }
.app-content:focus { outline: none; }
.app-footer { padding: 1rem 1.75rem; color: var(--app-muted); font-size: .8125rem; border-top: 1px solid #f0f2f7; }

.app-topbar {
	position: sticky; top: 0; z-index: 1020;
	display: flex; align-items: center; gap: .75rem;
	height: 72px; padding: 0 1.75rem;
	background: #fff; border-bottom: 1px solid #f0f2f7;
}
.app-page-title { font-size: 1.25rem; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--app-ink); }
.btn-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--app-ink); border-radius: 12px; }
.btn-icon:hover { background: var(--app-primary-soft); }
.btn-user { display: flex; align-items: center; gap: .6rem; border: 0; padding: .25rem .5rem; min-height: 44px; border-radius: 999px; }
.btn-user:hover, .btn-user:focus-visible { background: var(--app-primary-soft); }
.avatar {
	width: 36px; height: 36px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--app-primary); color: #fff; font-weight: 600;
}

/* ---------- sidebar ---------- */
.app-sidebar {
	--bs-offcanvas-width: var(--app-sidebar-width);
	--bs-offcanvas-bg: #fff;
	background: transparent;
	color: var(--app-sidebar-text);
	width: var(--app-sidebar-width);
	flex-shrink: 0;
}
@media (min-width: 992px) {
	.app-sidebar { position: sticky; top: 14px; height: calc(100vh - 28px); overflow-y: auto; display: flex; flex-direction: column; }
}
@media (max-width: 991.98px) {
	.app-sidebar { background: #fff; }
	.app-shell { padding: 0; }
	.app-main { border-radius: 0; min-height: 100vh; box-shadow: none; }
}
.sidebar-brand { display: flex; align-items: center; height: 72px; padding: 0 1.1rem; }
.brand-mark {
	width: 40px; height: 40px; border-radius: 14px;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--app-primary); color: #fff; font-size: 1.1rem;
}
.brand-logo {
	display: block; max-height: 44px; width: auto; max-width: 168px;
	object-fit: contain;
}
.brand-logo-lg {
	display: block; max-height: 72px; width: auto; max-width: 260px;
	margin-inline: auto; object-fit: contain;
}
.brand-text { color: var(--app-ink); font-weight: 700; font-size: .95rem; line-height: 1.2; letter-spacing: -.01em; }
.sidebar-nav { padding: .25rem .75rem 1.5rem; overflow-y: auto; }
.sidebar-nav .nav-heading {
	color: var(--app-sidebar-muted); font-size: .7rem; font-weight: 600;
	text-transform: uppercase; letter-spacing: .06em; padding: 1.1rem .75rem .35rem;
}
.sidebar-nav .nav-link {
	display: flex; align-items: center; gap: .7rem;
	color: var(--app-sidebar-text); border-radius: 12px;
	padding: .6rem .75rem; min-height: 42px; font-size: .9rem; font-weight: 500;
	transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--app-sidebar-hover); color: var(--app-ink); }
.sidebar-nav .nav-link:focus-visible { outline: 2px solid var(--app-primary); outline-offset: 1px; }
.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.active:hover { background: var(--app-sidebar-active); color: #fff; }
.sidebar-nav .sub-nav { padding: .15rem 0 .25rem 2.2rem; }
.sidebar-nav .sub-nav .nav-link { padding: .45rem .75rem; min-height: 36px; font-size: .85rem; }
.sidebar-nav .chevron { font-size: .75rem; transition: transform .2s ease; }
.sidebar-nav .nav-link:not(.collapsed) .chevron { transform: rotate(180deg); }

/* ---------- cards & tables ---------- */
.card {
	border: 0;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(23, 24, 31, .05);
}
.card-header {
	background: transparent;
	border-bottom-color: #f0f2f7;
	padding: 1.05rem 1.35rem;
	border-top-left-radius: 22px !important;
	border-top-right-radius: 22px !important;
}
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.card-body { padding: 1.15rem 1.35rem; }
.table > :not(caption) > * > * { padding: .8rem .9rem; border-bottom-color: #f0f2f7; }
.table thead th {
	font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
	color: var(--app-muted); font-weight: 600; background: #f7f8fb; white-space: nowrap; border-bottom-color: #f0f2f7;
}
.table-hover > tbody > tr:hover > * { background: #f7f8fb; }
.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn { min-width: 34px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; background: #eef0f6; }
.thumb-placeholder { width: 44px; height: 44px; border-radius: 12px; background: #eef0f6; display: inline-flex; align-items: center; justify-content: center; color: #9aa0ae; }

div.dt-container div.dt-search input { min-width: 240px; border-radius: 999px; background: #f4f6fb; }
div.dt-container .dt-paging .page-item.active .page-link { background: var(--app-primary); border-color: var(--app-primary); }

.badge-soft-success { background: #e8f7ee; color: #157a3a; }
.badge-soft-secondary { background: #eef0f5; color: #5c6370; }
.badge-soft-warning { background: #fff4e5; color: #9a5b00; }
.badge-soft-danger { background: #fdecec; color: #c42318; }
.badge-soft-info { background: #e8f1fd; color: #1859a8; }
.badge-soft-primary { background: var(--app-primary-soft); color: var(--app-primary); }

.stat-card .stat-icon {
	width: 52px; height: 52px; border-radius: 16px;
	display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
	background: var(--app-primary) !important; color: #fff !important; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.stat-card .stat-label { color: var(--app-muted); font-size: .85rem; }
.stat-card.bg-primary .stat-icon { background: rgba(255,255,255,.14) !important; }

.dash-donut { position: relative; width: 176px; height: 176px; flex: 0 0 176px; }
.dash-donut svg { display: block; width: 100%; height: 100%; }
.dash-donut-label {
	position: absolute; inset: 34px;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	text-align: center; line-height: 1.15; pointer-events: none;
}
.dash-donut-label strong { font-size: .82rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dash-donut-label span { margin-top: .15rem; font-size: .72rem; color: var(--app-muted); }
.dash-legend { list-style: none; margin: 0; padding: 0; }
.dash-legend li { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.dash-legend li + li { border-top: 1px solid var(--app-border); }
.dash-swatch { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; margin-right: .45rem; vertical-align: -1px; }

.select2-container--bootstrap-5 .select2-selection { min-height: calc(1.5em + .75rem + 2px); }

.dropdown-menu { border: 0; border-radius: 16px; box-shadow: 0 16px 40px rgba(23, 24, 31, .12); padding: .4rem; }
.dropdown-item { border-radius: 10px; }
.alert { border: 0; border-radius: 16px; }

/* permissions matrix */
.perm-module { border: 1px solid var(--app-border); border-radius: 16px; padding: .75rem 1rem; background: #fff; height: 100%; }
.perm-module h3 { font-size: .9rem; font-weight: 600; text-transform: capitalize; margin-bottom: .5rem; }

/* product form */
.variant-table td { vertical-align: top; min-width: 110px; }
.variant-table td.attr-cell { min-width: 140px; }
.image-tile { position: relative; border: 1px solid var(--app-border); border-radius: 14px; overflow: hidden; background: #fff; }
.image-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.image-tile .tile-actions { padding: .4rem .5rem; font-size: .8rem; }

/* billing */
.min-w-0 { min-width: 0; }
.bill-table th { font-size: .8rem; font-weight: 600; color: var(--app-muted); white-space: nowrap; }
.bill-table td { vertical-align: top; }
.bill-table .js-qty { min-width: 70px; }
.bill-table .js-price, .bill-table .js-charge-amount { min-width: 100px; }
.bill-table .js-disc { min-width: 64px; }
.charge-row { background: #f7f8fb; }
.summary-list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; }
.summary-list dt { font-weight: 400; color: var(--app-muted); }
.summary-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bill-total { font-size: 1.75rem; font-weight: 800; color: var(--app-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 991.98px) { .bill-summary { position: static !important; } }

/* auth */
.auth-page {
	min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
	position: relative; isolation: isolate;
	background: #1a0505;
	font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.auth-page::before {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background:
		radial-gradient(ellipse 55% 45% at 50% 20%, rgba(180, 40, 28, .5), transparent 70%),
		radial-gradient(ellipse 40% 35% at 15% 85%, rgba(120, 55, 20, .35), transparent 65%),
		linear-gradient(165deg, #5a1610 0%, #2c0a0a 45%, #140404 100%);
}
.auth-page::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background:
		linear-gradient(180deg, rgba(10,2,2,.25), rgba(8,1,1,.55)),
		radial-gradient(ellipse 70% 55% at 50% 40%, transparent 15%, rgba(8,1,1,.5) 100%);
	box-shadow: inset 0 0 120px 40px rgba(0,0,0,.4);
}
.auth-panel {
	width: 100%; max-width: 420px;
	border-radius: 28px;
	background: rgba(255, 252, 248, .96);
	border: 1px solid rgba(232, 197, 106, .28);
	box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
	overflow: hidden;
}
.auth-panel-body { padding: 2rem 1.6rem; }
@media (min-width: 576px) {
	.auth-panel-body { padding: 2.4rem 2.1rem; }
}
.auth-title {
	margin: 0 0 .25rem; font-size: 1.45rem; font-weight: 700;
	letter-spacing: -.02em; color: var(--app-ink);
}
.auth-subtitle, .auth-hint { color: var(--app-muted); }
.auth-page .brand-logo-lg {
	filter: drop-shadow(0 10px 24px rgba(168, 24, 24, .18));
}
.auth-page .btn-primary {
	background: linear-gradient(180deg, #c01f1f 0%, #8b1515 100%);
	border: 0; box-shadow: 0 10px 24px rgba(168, 24, 24, .28);
}
.auth-page .btn-primary:hover {
	background: linear-gradient(180deg, #a81818 0%, #6b1212 100%);
}
.auth-card { width: 100%; max-width: 420px; border-radius: 28px; box-shadow: var(--app-shadow); border-top: 3px solid var(--app-accent); }

@media (max-width: 575.98px) {
	.app-content { padding: 1rem; }
	.app-topbar { padding: 0 .75rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; }
}
@media print {
	.app-sidebar, .app-topbar, .app-footer, .no-print { display: none !important; }
	.app-content { padding: 0; }
	.app-main { box-shadow: none; border-radius: 0; }
	body, .app-shell { background: #fff; padding: 0; }
}
