/* Lusterlight Product Manager — mobile-first dashboard styles.
   Brand: Lusterlight — premium fashion, simple management.
   Primary #8B0D1B / Accent #CB8F3C.
   Scoped entirely under #lpm-app and .lpm-login-page so it never
   leaks into WoodMart, wp-admin, or other plugins. */

#lpm-app,
.lpm-login-page {
	--lpm-primary: #8B0D1B;
	--lpm-primary-dark: #6b0a15;
	--lpm-primary-soft: #f7e7e8;
	--lpm-accent: #CB8F3C;
	--lpm-accent-soft: #f7ecd9;
	--lpm-danger: #dc2626;
	--lpm-bg: #f7f5f3;
	--lpm-card-bg: #ffffff;
	--lpm-border: #ece6e1;
	--lpm-text: #241417;
	--lpm-muted: #85766f;
}

#lpm-app {
	max-width: 560px;
	margin: 0 auto;
	background: var(--lpm-bg);
	color: var(--lpm-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.45;
	padding-bottom: 96px;
	box-sizing: border-box;
}

#lpm-app *,
#lpm-app *::before,
#lpm-app *::after,
.lpm-login-page *,
.lpm-login-page *::before,
.lpm-login-page *::after {
	box-sizing: border-box;
}

#lpm-app input:focus-visible,
#lpm-app select:focus-visible,
#lpm-app textarea:focus-visible,
#lpm-app button:focus-visible,
.lpm-login-page input:focus-visible,
.lpm-login-page button:focus-visible {
	outline: 2px solid var(--lpm-accent);
	outline-offset: 2px;
}

.lpm-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--lpm-primary);
	color: #fff;
	padding: 20px 16px;
	text-align: center;
	border-bottom: 3px solid var(--lpm-accent);
}
.lpm-header-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0.3px;
}

.lpm-tabbar {
	position: sticky;
	top: 60px;
	z-index: 19;
	display: flex;
	background: #fff;
	border-bottom: 1px solid var(--lpm-border);
}
.lpm-tab {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 11px 4px;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	font-size: 13px;
	color: var(--lpm-muted);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.lpm-tab-icon { font-size: 18px; }
.lpm-tab.is-active {
	color: var(--lpm-primary);
	font-weight: 700;
	border-bottom-color: var(--lpm-primary);
}

.lpm-main { padding: 16px; }

.lpm-view { display: none; }
.lpm-view.is-active { display: block; }

.lpm-view-title {
	font-size: 18px;
	font-weight: 700;
	margin: 4px 0 16px;
	color: var(--lpm-text);
}

.lpm-card {
	background: var(--lpm-card-bg);
	border: 1px solid var(--lpm-border);
	border-radius: 16px;
	padding: 18px;
	margin-bottom: 16px;
	box-shadow: 0 1px 3px rgba(36,20,23,0.05);
}
.lpm-card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--lpm-text);
}
.lpm-card-title::before {
	content: '';
	display: inline-block;
	width: 4px;
	height: 15px;
	border-radius: 2px;
	background: var(--lpm-accent);
	flex-shrink: 0;
}

.lpm-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin: 14px 0 6px;
	color: var(--lpm-muted);
}
.lpm-label:first-child { margin-top: 0; }
.lpm-req { color: var(--lpm-primary); }

.lpm-input,
.lpm-textarea,
select.lpm-input {
	width: 100%;
	padding: 14px;
	font-size: 16px;
	border: 1px solid var(--lpm-border);
	border-radius: 12px;
	background: #faf9f8;
	color: var(--lpm-text);
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.lpm-input:focus,
.lpm-textarea:focus {
	outline: none;
	border-color: var(--lpm-primary);
	background: #fff;
}
.lpm-textarea { resize: vertical; min-height: 70px; }
.lpm-help { font-size: 13px; color: var(--lpm-muted); margin: 0 0 14px; }

.lpm-select-wrap { position: relative; }
.lpm-select-wrap::after {
	content: '';
	position: absolute;
	right: 16px;
	top: 50%;
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--lpm-muted);
	border-bottom: 2px solid var(--lpm-muted);
	transform: translateY(-65%) rotate(45deg);
	pointer-events: none;
}
.lpm-select-wrap select { padding-right: 40px; }

.lpm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px 18px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 12px;
	border: none;
	cursor: pointer;
	min-height: 48px;
	transition: background 0.15s ease, transform 0.05s ease;
}
.lpm-btn-block { width: 100%; }
.lpm-btn-primary { background: var(--lpm-primary); color: #fff; box-shadow: 0 4px 14px rgba(139,13,27,0.28); }
.lpm-btn-primary:active { background: var(--lpm-primary-dark); transform: scale(0.99); }
.lpm-btn-secondary { background: var(--lpm-primary-soft); color: var(--lpm-primary-dark); }
.lpm-btn-secondary:active { background: #eed7d9; }
.lpm-btn-danger { background: var(--lpm-danger); color: #fff; }
.lpm-btn[disabled] { opacity: 0.5; pointer-events: none; }

.lpm-tiers-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.lpm-tier-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 8px;
	align-items: end;
	background: #faf9f8;
	border: 1px solid var(--lpm-border);
	border-radius: 12px;
	padding: 10px;
}
.lpm-tier-field label { display: block; font-size: 11px; color: var(--lpm-muted); margin-bottom: 4px; }
.lpm-tier-remove {
	background: var(--lpm-primary-soft);
	color: var(--lpm-primary-dark);
	border: none;
	border-radius: 10px;
	width: 44px;
	height: 44px;
	font-size: 16px;
	cursor: pointer;
}

.lpm-customer-fields-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.lpm-customer-field-row {
	background: #faf9f8;
	border: 1px solid var(--lpm-border);
	border-radius: 12px;
	padding: 14px;
}
.lpm-customer-field-row label { display: block; font-size: 12px; color: var(--lpm-muted); margin: 8px 0 4px; }
.lpm-customer-field-row label:first-of-type { margin-top: 0; }
.lpm-cf-row-controls { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.lpm-cf-control { flex: 1; }
.lpm-cf-control label { margin-top: 0; }
.lpm-cf-required-row { flex: 0 0 auto; padding-bottom: 12px; gap: 8px; }
.lpm-cf-remove { margin-top: 12px; background: var(--lpm-primary-soft); color: var(--lpm-primary-dark); }

.lpm-upload-zone {
	border: 2px dashed var(--lpm-border);
	border-radius: 16px;
	background: #faf9f8;
	padding: 18px;
	text-align: center;
}
.lpm-upload-icon { display: block; font-size: 26px; margin: 2px 0 10px; opacity: 0.85; }
.lpm-upload-zone .lpm-image-preview:empty { display: none; }
.lpm-upload-zone .lpm-image-preview:not(:empty) { margin-bottom: 12px; }

.lpm-image-preview { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.lpm-thumb {
	width: 72px; height: 72px; object-fit: cover;
	border-radius: 12px; border: 1px solid var(--lpm-border);
}
.lpm-thumb-wrap { position: relative; }
.lpm-thumb-remove {
	position: absolute; top: -6px; right: -6px;
	width: 22px; height: 22px; border-radius: 50%;
	background: var(--lpm-primary); color: #fff; border: none; font-size: 12px; line-height: 1;
	cursor: pointer;
}
.lpm-file-input { display: none; }

.lpm-inline-add { display: flex; gap: 8px; margin-top: 12px; }
.lpm-inline-add .lpm-input { flex: 1; }

.lpm-switch-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.lpm-switch-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--lpm-primary); }

.lpm-sticky-bar {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	z-index: 30;
	background: #fff;
	border-top: 1px solid var(--lpm-border);
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	max-width: 560px;
	margin: 0 auto;
	box-shadow: 0 -4px 16px rgba(36,20,23,0.06);
}

.lpm-notice { padding: 13px 15px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.lpm-notice-error { background: #fdeceb; color: #8a1f16; border: 1px solid #f4c6c0; }
.lpm-notice-success { background: var(--lpm-accent-soft); color: #6b4d18; border: 1px solid #ecd4a4; }

.lpm-toast {
	position: fixed;
	top: 70px; left: 50%;
	transform: translateX(-50%) translateY(-10px);
	background: var(--lpm-text); color: #fff;
	padding: 12px 18px; border-radius: 12px;
	font-size: 14px; max-width: 90%;
	opacity: 0; pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 100;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.lpm-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.lpm-toast.is-error { background: var(--lpm-danger); }

.lpm-products-list { display: flex; flex-direction: column; gap: 10px; }
.lpm-product-row {
	display: flex; align-items: center; gap: 12px;
	background: var(--lpm-card-bg); border: 1px solid var(--lpm-border);
	border-radius: 14px; padding: 10px;
	box-shadow: 0 1px 3px rgba(36,20,23,0.05);
}
.lpm-product-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.lpm-product-info { flex: 1; min-width: 0; }
.lpm-product-name { font-weight: 700; font-size: 14px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lpm-product-meta { font-size: 12px; color: var(--lpm-muted); }
.lpm-product-actions { display: flex; gap: 6px; }
.lpm-icon-btn {
	width: 40px; height: 40px; border-radius: 10px; border: none;
	background: var(--lpm-primary-soft); color: var(--lpm-primary-dark); font-size: 15px; cursor: pointer;
}
.lpm-icon-btn.lpm-danger { background: #fdeceb; color: var(--lpm-danger); }

.lpm-stock-badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px; margin-top: 3px; font-weight: 600; }
.lpm-stock-instock { background: #dcfce7; color: #166534; }
.lpm-stock-outofstock { background: #fdeceb; color: #8a1f16; }
.lpm-stock-onbackorder { background: var(--lpm-accent-soft); color: #6b4d18; }

.lpm-modal {
	position: fixed; inset: 0; background: rgba(36,20,23,0.55);
	display: flex; align-items: center; justify-content: center;
	z-index: 200; padding: 20px;
}
.lpm-modal-box { background: #fff; border-radius: 18px; padding: 22px; max-width: 340px; width: 100%; }
.lpm-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.lpm-modal-actions .lpm-btn { flex: 1; }

.lpm-loading { text-align: center; padding: 30px; color: var(--lpm-muted); }

/* ---------------------------------------------------------------
   Login screen
   --------------------------------------------------------------- */

.lpm-login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: linear-gradient(160deg, #241417 0%, #3a1c21 60%, #4a2029 100%);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lpm-login-card {
	background: #fff;
	border-radius: 22px;
	padding: 34px 26px;
	max-width: 380px;
	width: 100%;
	box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.lpm-login-brand { text-align: center; margin-bottom: 26px; }
.lpm-login-logo {
	width: 56px; height: 56px;
	border-radius: 16px;
	background: var(--lpm-primary);
	color: #fff;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 26px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
	box-shadow: 0 8px 20px rgba(139,13,27,0.35);
}
.lpm-login-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 4px;
	color: var(--lpm-text);
	letter-spacing: 0.5px;
}
.lpm-login-tagline { font-size: 13px; color: var(--lpm-muted); margin: 0; }

.lpm-login-error {
	background: #fdeceb;
	color: #8a1f16;
	border: 1px solid #f4c6c0;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 13px;
	margin-bottom: 18px;
	text-align: center;
}

/* Targets WordPress core's own wp_login_form() markup by element type,
   scoped strictly under .lpm-login-card — never touches wp-login.php. */
.lpm-login-card #loginform { border: none; padding: 0; margin: 0; box-shadow: none; background: none; }
.lpm-login-card p { margin: 0 0 16px; }
.lpm-login-card label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--lpm-muted);
	margin-bottom: 6px;
}
.lpm-login-card input[type="text"],
.lpm-login-card input[type="password"],
.lpm-login-card input[type="email"] {
	width: 100%;
	padding: 14px;
	font-size: 16px;
	border: 1px solid var(--lpm-border);
	border-radius: 12px;
	background: #faf9f8;
	color: var(--lpm-text);
}
.lpm-login-card input[type="text"]:focus,
.lpm-login-card input[type="password"]:focus {
	outline: none;
	border-color: var(--lpm-primary);
	background: #fff;
}
.lpm-login-card .forgetmenot { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lpm-muted); }
.lpm-login-card .forgetmenot label { display: inline; margin: 0; font-weight: 400; }
.lpm-login-card .forgetmenot input { width: 18px; height: 18px; accent-color: var(--lpm-primary); }
.lpm-login-card .submit { margin-top: 6px; margin-bottom: 0; }
.lpm-login-card #wp-submit,
.lpm-login-card input[type="submit"] {
	width: 100%;
	padding: 14px;
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 12px;
	background: var(--lpm-primary);
	color: #fff;
	cursor: pointer;
	min-height: 48px;
	box-shadow: 0 4px 14px rgba(139,13,27,0.28);
}
.lpm-login-card #wp-submit:active { background: var(--lpm-primary-dark); }

.lpm-password-wrap { position: relative; }
.lpm-password-wrap input[type="password"],
.lpm-password-wrap input[type="text"] { padding-right: 46px; }
.lpm-password-toggle {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: var(--lpm-muted);
	padding: 8px;
}

.lpm-login-wrap { max-width: 360px; margin: 40px auto; padding: 20px; }
