/**
 * WexaPOS Brand Overrides
 * --------------------------------------------------
 * Re-skins the inner app from the Rocker Admin default blue (#008cff)
 * to the WexaPOS emerald palette. Loads AFTER custom.css so the cascade
 * wins without touching vendor stylesheets.
 *
 *   Primary:        #10B981  (emerald-500, the W in the WexaPOS logo)
 *   Primary hover:  #059669  (emerald-600)
 *   Primary subtle: #ECFDF5  (emerald-50, light tints)
 *   Subtle border:  #A7F3D0  (emerald-200)
 */

:root {
	--wxp-primary:        #10B981;
	--wxp-primary-hover:  #059669;
	--wxp-primary-active: #047857;
	--wxp-primary-soft:   #ECFDF5;
	--wxp-primary-border: #A7F3D0;
	--wxp-primary-shadow: rgba(16, 185, 129, .25);

	/* Darker shades used for solid CTA buttons so they complement the dark
	 * sidebar gradient instead of clashing with it. Lighter --wxp-primary
	 * stays for links, accents, sidebar active bar, badges, etc. */
	--wxp-btn-bg:         #047857;  /* emerald-700 */
	--wxp-btn-hover:      #065F46;  /* emerald-800 */
	--wxp-btn-active:     #064E3B;  /* emerald-900 */
	--wxp-btn-shadow:     rgba(4, 120, 87, .30);

	/* Override Bootstrap's CSS variables where the theme reads them */
	--bs-primary: #10B981;
	--bs-primary-rgb: 16, 185, 129;
	--bs-link-color: #059669;
	--bs-link-color-rgb: 5, 150, 105;
	--bs-link-hover-color: #047857;
	--bs-link-hover-color-rgb: 4, 120, 87;
}

/* ---------- Links ---------- */
a { color: var(--wxp-primary-hover); }
a:hover, a:focus { color: var(--wxp-primary-active); }

/* ---------- Buttons ---------- */
.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled {
	color: #fff !important;
	background-color: var(--wxp-btn-bg) !important;
	border-color: var(--wxp-btn-bg) !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-check:focus + .btn-primary,
.btn-check:active + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
	color: #fff !important;
	background-color: var(--wxp-btn-hover) !important;
	border-color: var(--wxp-btn-hover) !important;
	box-shadow: 0 0 0 .25rem var(--wxp-btn-shadow) !important;
}

.btn-outline-primary {
	color: var(--wxp-btn-bg) !important;
	border-color: var(--wxp-btn-bg) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active,
.btn-outline-primary:active,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
	color: #fff !important;
	background-color: var(--wxp-btn-bg) !important;
	border-color: var(--wxp-btn-bg) !important;
	box-shadow: 0 0 0 .25rem var(--wxp-btn-shadow) !important;
}

.btn-inverse-primary {
	background-color: var(--wxp-primary-soft) !important;
	color: var(--wxp-primary-hover) !important;
	border-color: transparent !important;
}
.btn-inverse-primary:hover,
.btn-inverse-primary:focus,
.btn-inverse-primary:active {
	background-color: var(--wxp-primary) !important;
	color: #fff !important;
	border-color: var(--wxp-primary) !important;
}

.split-bg-primary { background-color: var(--wxp-primary-hover) !important; }

/* ---------- Backgrounds & text utilities ---------- */
.bg-primary { background-color: var(--wxp-primary) !important; }
.text-primary { color: var(--wxp-primary-hover) !important; }
.border-primary { border-color: var(--wxp-primary) !important; }
.bg-light-primary { background-color: var(--wxp-primary-soft) !important; }

/* ---------- Forms ---------- */
.form-control:focus,
.form-select:focus {
	border-color: var(--wxp-primary) !important;
	box-shadow: 0 0 0 .25rem var(--wxp-primary-shadow) !important;
}
.form-check-input:focus {
	border-color: var(--wxp-primary) !important;
	box-shadow: 0 0 0 .25rem var(--wxp-primary-shadow) !important;
}
.form-check-input:checked {
	background-color: var(--wxp-primary) !important;
	border-color: var(--wxp-primary) !important;
}
.form-switch .form-check-input:focus {
	border-color: var(--wxp-primary) !important;
}

/* ---------- Nav tabs / pills ---------- */
.nav-primary.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active.text-primary {
	color: var(--wxp-primary-hover) !important;
	border-bottom-color: var(--wxp-primary) !important;
}
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
	background-color: var(--wxp-primary) !important;
	color: #fff !important;
}

/* ---------- Sidebar / menu (Metismenu) active item ---------- */
.metismenu .mm-active > a,
.metismenu a:hover,
.metismenu a:focus,
.metismenu a:active {
	color: var(--wxp-primary-hover) !important;
}
.metismenu .mm-active > a .parent-icon,
.metismenu a:hover .parent-icon {
	color: var(--wxp-primary-hover) !important;
}
.sidebar-wrapper .simplebar-content > ul li a.mm-active {
	color: var(--wxp-primary-hover) !important;
}

/* ---------- Pagination ---------- */
.page-link {
	color: var(--wxp-primary-hover);
}
.page-link:hover {
	color: var(--wxp-primary-active);
}
.page-item.active .page-link {
	background-color: var(--wxp-primary) !important;
	border-color: var(--wxp-primary) !important;
	color: #fff !important;
}
.page-link:focus {
	box-shadow: 0 0 0 .25rem var(--wxp-primary-shadow);
}

/* ---------- Dropdowns ---------- */
.dropdown-item.active,
.dropdown-item:active {
	background-color: var(--wxp-primary) !important;
	color: #fff !important;
}

/* ---------- Progress / spinner / list-group active ---------- */
.progress-bar { background-color: var(--wxp-primary); }
.spinner-border.text-primary,
.spinner-grow.text-primary { color: var(--wxp-primary) !important; }
.list-group-item.active {
	background-color: var(--wxp-primary) !important;
	border-color: var(--wxp-primary) !important;
	color: #fff !important;
}

/* ---------- Badges ---------- */
.badge.bg-primary { background-color: var(--wxp-primary) !important; }
.badge.bg-light-primary {
	background-color: var(--wxp-primary-soft) !important;
	color: var(--wxp-primary-hover) !important;
}

/* ---------- Alerts ---------- */
.alert-primary {
	background-color: var(--wxp-primary-soft) !important;
	border-color: var(--wxp-primary-border) !important;
	color: var(--wxp-primary-active) !important;
}

/* ---------- Switcher swatches keep accurate (pure visual; no functional change) ---------- */
.switcher-body .headercolor1 {
	background-image: linear-gradient(to right, var(--wxp-primary), var(--wxp-primary-hover)) !important;
}

/* ---------- Select2 (used widely in forms) ---------- */
.select2-container--bootstrap-5 .select2-selection--single:focus,
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5 .select2-dropdown {
	border-color: var(--wxp-primary) !important;
}
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap-5 .select2-results__option--selected {
	background-color: var(--wxp-primary) !important;
	color: #fff !important;
}

/* ---------- Focus ring on interactive elements ---------- */
.btn:focus-visible,
.form-control:focus-visible {
	outline-color: var(--wxp-primary);
}

/* ====================================================================
 * SIDEBAR — dark gradient brand panel (matches login left panel)
 * ==================================================================== */

.sidebar-wrapper {
	background:
		radial-gradient(circle at 30% 35%, rgba(16,185,129,0.25), transparent 40%),
		radial-gradient(circle at 70% 65%, rgba(20,184,166,0.20), transparent 50%),
		linear-gradient(180deg, #020617 0%, #031a16 100%) !important;
	border-right: 1px solid rgba(255,255,255,0.06) !important;
	box-shadow: 0 2px 12px rgba(0,0,0,0.25) !important;
}

.sidebar-header {
	background: transparent !important;
	border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

/* Sidebar logo (image + SVG wordmark from login page) */
.sidebar-header .logo-icon {
	height: 32px;
	width: auto;
}
.sidebar-header .logo-svg {
	height: 22px;
	width: auto;
	display: block;
}
/* Hide the wordmark when the sidebar is collapsed (mirrors theme's .logo-text rule) */
@media screen and (min-width: 1025px) {
	.wrapper.toggled:not(.sidebar-hovered) .sidebar-wrapper .sidebar-header .logo-svg {
		display: none;
	}
}

.toggle-icon {
	color: var(--wxp-primary) !important;
}

/* Section labels ("CORE", "INVENTORY", etc.) */
.menu-label {
	color: #64748b !important;          /* slate-500 */
}

/* Menu items — base state */
.sidebar-wrapper .metismenu a {
	color: #cbd5e1 !important;          /* slate-300 */
}
.sidebar-wrapper .metismenu a .parent-icon {
	color: #94a3b8;                     /* slate-400 — slightly dimmer than text */
}

/* Menu items — hover */
.sidebar-wrapper .metismenu a:hover,
.sidebar-wrapper .metismenu a:focus {
	color: #ffffff !important;
	background-color: rgba(255,255,255,0.04) !important;
	text-decoration: none !important;
}
.sidebar-wrapper .metismenu a:hover .parent-icon,
.sidebar-wrapper .metismenu a:focus .parent-icon {
	color: var(--wxp-primary) !important;
}

/* Menu items — active (current route) */
.sidebar-wrapper .metismenu .mm-active > a,
.sidebar-wrapper .metismenu a:active {
	color: #ffffff !important;
	background-color: rgba(16,185,129,0.18) !important;
	box-shadow: inset 3px 0 0 var(--wxp-primary);
}
.sidebar-wrapper .metismenu .mm-active > a .parent-icon,
.sidebar-wrapper .metismenu a:active .parent-icon {
	color: var(--wxp-primary) !important;
}

/* Submenu (expanded) — transparent so the gradient shows through */
.sidebar-wrapper .metismenu ul {
	background: rgba(0,0,0,0.18) !important;
}
.sidebar-wrapper .metismenu ul a {
	color: #94a3b8 !important;          /* slate-400 for nested items */
}
.sidebar-wrapper .metismenu ul a:hover,
.sidebar-wrapper .metismenu ul a:focus {
	color: #ffffff !important;
	background-color: rgba(255,255,255,0.04) !important;
}
.sidebar-wrapper .metismenu ul .mm-active > a {
	color: #ffffff !important;
	background-color: rgba(16,185,129,0.14) !important;
	box-shadow: inset 3px 0 0 var(--wxp-primary);
}

/* Has-arrow chevron — match the lighter text */
.sidebar-wrapper .metismenu .has-arrow:after {
	border-color: #94a3b8 !important;
}
.sidebar-wrapper .metismenu .mm-active > .has-arrow:after,
.sidebar-wrapper .metismenu a:hover.has-arrow:after {
	border-color: var(--wxp-primary) !important;
}

/* Simplebar (custom scrollbar) — soften the track on dark bg */
.sidebar-wrapper .simplebar-scrollbar::before {
	background: rgba(255,255,255,0.18) !important;
}

/* ====================================================================
 * CONTENT AREA POLISH
 *
 * Structure (border-radius, focus rings, emerald accents, sizing) is
 * theme-agnostic. Color/background rules that only make sense in light
 * mode are scoped under `html:not(.dark-theme)` so the existing
 * dark-theme.css can keep doing its thing. A small dark-mode block at
 * the end handles the few tweaks needed for parity in dark.
 * ==================================================================== */

/* ---------- Theme-agnostic structure ---------- */
.page-content .card {
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .2s ease;
}

.page-content .card > .card-header {
	position: relative;
}
.page-content .card > .card-header::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 3px;
	background: linear-gradient(180deg, var(--wxp-primary) 0%, var(--wxp-btn-bg) 100%);
}
.page-content .card > .card-header h5 {
	letter-spacing: 0.04em;
	font-weight: 700;
	font-size: 14px;
}

/* DataTables empty state — emerald icon tile works on both themes */
.dataTables_wrapper .dataTables_empty,
table.dataTable tbody td.dataTables_empty {
	padding: 56px 24px !important;
	text-align: center !important;
	font-size: 14px !important;
	background: transparent !important;
	border: 0 !important;
}
.dataTables_wrapper .dataTables_empty::before,
table.dataTable tbody td.dataTables_empty::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 12px;
	background-color: var(--wxp-primary-soft);
	border-radius: 50%;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/><polyline points='3.27 6.96 12 12.01 20.73 6.96'/><line x1='12' y1='22.08' x2='12' y2='12'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 28px 28px;
}

/* DataTables length/filter inputs — focus ring is emerald in both themes */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 13px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
	border-color: var(--wxp-primary) !important;
	box-shadow: 0 0 0 3px var(--wxp-primary-shadow) !important;
	outline: none;
}

/* DataTables button toolbar — pill group structure */
.dt-buttons {
	display: inline-flex;
	gap: 0;
	border-radius: 10px;
	overflow: hidden;
	padding: 2px;
}
.dt-buttons .dt-button,
.dt-buttons .btn {
	background: transparent !important;
	border: 0 !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	padding: 6px 14px !important;
	border-radius: 8px !important;
	letter-spacing: 0.02em;
	transition: background .15s ease, color .15s ease;
	box-shadow: none !important;
}

/* Tables: type sizing */
.page-content table.table {
	font-size: 13.5px;
}
.page-content table.table > thead > tr > th {
	font-weight: 600;
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.page-content .breadcrumb,
.page-content nav[aria-label="breadcrumb"] ol {
	font-size: 13px;
	margin-bottom: 18px;
}

.page-content .form-select {
	border-radius: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
	border-radius: 8px !important;
	margin: 0 2px !important;
	border: 1px solid transparent !important;
	font-size: 12.5px !important;
	padding: 6px 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
	background: var(--wxp-btn-bg) !important;
	border-color: var(--wxp-btn-bg) !important;
	color: #ffffff !important;
}

button.buttons-delete,
.btn.buttons-delete,
.dt-buttons .dt-button.buttons-delete:hover,
.dt-buttons .btn.buttons-delete:hover {
	color: #dc2626 !important;
}

/* ---------- Light-mode-only colors ---------- */
html:not(.dark-theme) .page-content {
	background:
		radial-gradient(900px 500px at 100% 0%, rgba(16,185,129,0.04), transparent 70%),
		linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
	min-height: 100%;
}

html:not(.dark-theme) .page-content .card {
	border: 1px solid rgba(15, 23, 42, 0.06);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
}
html:not(.dark-theme) .page-content .card:hover {
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

html:not(.dark-theme) .page-content .card > .card-header {
	background: #ffffff;
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
html:not(.dark-theme) .page-content .card > .card-header h5 {
	color: #0f172a;
}

html:not(.dark-theme) .dataTables_wrapper .dataTables_empty,
html:not(.dark-theme) table.dataTable tbody td.dataTables_empty {
	color: #64748b !important;
}

html:not(.dark-theme) .dataTables_wrapper .dataTables_length,
html:not(.dark-theme) .dataTables_wrapper .dataTables_filter {
	color: #475569;
}
html:not(.dark-theme) .dataTables_wrapper .dataTables_length select,
html:not(.dark-theme) .dataTables_wrapper .dataTables_filter input {
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #0f172a;
}
html:not(.dark-theme) .dataTables_wrapper .dataTables_info {
	color: #64748b;
	font-size: 12.5px;
}

html:not(.dark-theme) .dt-buttons {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
}
html:not(.dark-theme) .dt-buttons .dt-button,
html:not(.dark-theme) .dt-buttons .btn {
	color: #475569 !important;
}
html:not(.dark-theme) .dt-buttons .dt-button:hover,
html:not(.dark-theme) .dt-buttons .btn:hover,
html:not(.dark-theme) .dt-buttons .dt-button:focus,
html:not(.dark-theme) .dt-buttons .btn:focus {
	background: #ffffff !important;
	color: var(--wxp-btn-bg) !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark-theme) .page-content table.table > thead > tr > th {
	background: #f8fafc;
	color: #475569;
	border-bottom: 1px solid #e2e8f0;
}
html:not(.dark-theme) .page-content table.table > tbody > tr:hover {
	background: var(--wxp-primary-soft);
}
html:not(.dark-theme) .page-content table.table-bordered,
html:not(.dark-theme) .page-content table.table-bordered > :not(caption) > * > * {
	border-color: #eef2f7 !important;
}

html:not(.dark-theme) .page-content .breadcrumb-item a {
	color: #64748b;
	text-decoration: none;
	transition: color .15s ease;
}
html:not(.dark-theme) .page-content .breadcrumb-item a:hover {
	color: var(--wxp-btn-bg);
}
html:not(.dark-theme) .page-content .breadcrumb-item.active {
	color: #0f172a;
	font-weight: 500;
}

html:not(.dark-theme) .page-content .form-select {
	border-color: #e2e8f0;
}

html:not(.dark-theme) .dataTables_wrapper .dataTables_paginate .paginate_button {
	color: #475569 !important;
}
html:not(.dark-theme) .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
	background: var(--wxp-primary-soft) !important;
	border-color: var(--wxp-primary-border) !important;
	color: var(--wxp-btn-bg) !important;
}

/* ---------- Dark-mode tweaks (keeps the polish without forcing white) ---------- */
html.dark-theme .page-content .card {
	border: 1px solid rgba(255, 255, 255, 0.06);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.25);
}
html.dark-theme .page-content .card:hover {
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 8px 24px rgba(0, 0, 0, 0.35);
}
html.dark-theme .page-content .card > .card-header {
	background: transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html.dark-theme .page-content .card > .card-header h5 {
	color: #e4e5e6;
}
html.dark-theme .page-content table.table > thead > tr > th {
	background: rgba(255, 255, 255, 0.03);
	color: #cbd5e1;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
html.dark-theme .page-content table.table > tbody > tr:hover {
	background: rgba(16, 185, 129, 0.08);
}
html.dark-theme .page-content table.table-bordered,
html.dark-theme .page-content table.table-bordered > :not(caption) > * > * {
	border-color: rgba(255, 255, 255, 0.06) !important;
}
html.dark-theme .dataTables_wrapper .dataTables_length select,
html.dark-theme .dataTables_wrapper .dataTables_filter input {
	border: 1px solid rgba(255, 255, 255, 0.10);
	background: #12181a;
	color: #e4e5e6;
}
html.dark-theme .dt-buttons {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
html.dark-theme .dt-buttons .dt-button,
html.dark-theme .dt-buttons .btn {
	color: #cbd5e1 !important;
}
html.dark-theme .dt-buttons .dt-button:hover,
html.dark-theme .dt-buttons .btn:hover,
html.dark-theme .dt-buttons .dt-button:focus,
html.dark-theme .dt-buttons .btn:focus {
	background: rgba(16, 185, 129, 0.12) !important;
	color: var(--wxp-primary) !important;
	box-shadow: none !important;
}
html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
	color: #cbd5e1 !important;
}
html.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
	background: rgba(16, 185, 129, 0.12) !important;
	border-color: rgba(16, 185, 129, 0.30) !important;
	color: var(--wxp-primary) !important;
}
html.dark-theme .page-content .breadcrumb-item a {
	color: #94a3b8;
}
html.dark-theme .page-content .breadcrumb-item.active {
	color: #e4e5e6;
}
html.dark-theme .dataTables_wrapper .dataTables_info,
html.dark-theme .dataTables_wrapper .dataTables_length,
html.dark-theme .dataTables_wrapper .dataTables_filter {
	color: #94a3b8;
}
