/* ===========================
   Bab Al-Najah — Mobile-First
   Dark/Light Theme System
   =========================== */

/* --- CSS Custom Properties (Light Theme — Default) --- */
:root {
	color-scheme: light dark;

	/* Core palette */
	--primary: #2563eb;
	--primary-hover: #1d4ed8;
	--primary-soft: rgba(37, 99, 235, 0.10);
	--primary-glow: rgba(37, 99, 235, 0.25);

	--accent: #f59e0b;
	--accent-soft: rgba(245, 158, 11, 0.12);

	--danger: #ef4444;
	--danger-hover: #dc2626;
	--danger-soft: rgba(239, 68, 68, 0.10);

	--success: #10b981;
	--success-soft: rgba(16, 185, 129, 0.10);

	--info: #3b82f6;
	--info-hover: #2563eb;

	/* Surfaces */
	--bg: #f1f5f9;
	--bg-elevated: #ffffff;
	--surface: #ffffff;
	--surface-hover: #f8fafc;
	--surface-alt: #f8fafc;
	--surface-border: rgba(0, 0, 0, 0.06);

	/* Text */
	--text: #0f172a;
	--text-secondary: #475569;
	--text-muted: #94a3b8;
	--text-inverse: #ffffff;

	/* Lines & Borders */
	--border: #e2e8f0;
	--border-strong: #cbd5e1;

	/* Shadows */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
	--shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.10);
	--shadow-focus: 0 0 0 3px var(--primary-soft);

	/* Radii */
	--radius-xs: 8px;
	--radius-sm: 12px;
	--radius-md: 16px;
	--radius-lg: 20px;
	--radius-xl: 24px;
	--radius-full: 999px;

	/* Transitions */
	--ease: cubic-bezier(0.4, 0, 0.2, 1);
	--duration: 0.2s;

	/* Layout */
	--bottom-nav-height: 64px;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
	--primary: #60a5fa;
	--primary-hover: #93bbfd;
	--primary-soft: rgba(96, 165, 250, 0.12);
	--primary-glow: rgba(96, 165, 250, 0.20);

	--accent: #fbbf24;
	--accent-soft: rgba(251, 191, 36, 0.12);

	--danger: #f87171;
	--danger-hover: #fca5a5;
	--danger-soft: rgba(248, 113, 113, 0.12);

	--success: #34d399;
	--success-soft: rgba(52, 211, 153, 0.12);

	--info: #60a5fa;
	--info-hover: #93bbfd;

	--bg: #0f172a;
	--bg-elevated: #1e293b;
	--surface: #1e293b;
	--surface-hover: #273549;
	--surface-alt: #273549;
	--surface-border: rgba(255, 255, 255, 0.06);

	--text: #f1f5f9;
	--text-secondary: #94a3b8;
	--text-muted: #64748b;
	--text-inverse: #0f172a;

	--border: #334155;
	--border-strong: #475569;

	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
	--shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
	--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
	--shadow-focus: 0 0 0 3px var(--primary-soft);
}

/* System preference detection (fallback when no data-theme set) */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--primary: #60a5fa;
		--primary-hover: #93bbfd;
		--primary-soft: rgba(96, 165, 250, 0.12);
		--primary-glow: rgba(96, 165, 250, 0.20);

		--accent: #fbbf24;
		--accent-soft: rgba(251, 191, 36, 0.12);

		--danger: #f87171;
		--danger-hover: #fca5a5;
		--danger-soft: rgba(248, 113, 113, 0.12);

		--success: #34d399;
		--success-soft: rgba(52, 211, 153, 0.12);

		--info: #60a5fa;
		--info-hover: #93bbfd;

		--bg: #0f172a;
		--bg-elevated: #1e293b;
		--surface: #1e293b;
		--surface-hover: #273549;
		--surface-alt: #273549;
		--surface-border: rgba(255, 255, 255, 0.06);

		--text: #f1f5f9;
		--text-secondary: #94a3b8;
		--text-muted: #64748b;
		--text-inverse: #0f172a;

		--border: #334155;
		--border-strong: #475569;

		--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
		--shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
		--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
		--shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
		--shadow-focus: 0 0 0 3px var(--primary-soft);
	}
}


/* ===========================
   Reset & Base
   =========================== */
html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: "Readex Pro", "Segoe UI", Tahoma, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	direction: rtl;
	text-align: right;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}

a {
	color: var(--primary);
	text-decoration: none;
	transition: color var(--duration) var(--ease);
}

a:hover {
	color: var(--primary-hover);
}

img {
	max-width: 100%;
	display: block;
}

h1,
h2,
h3,
h4,
p {
	margin: 0;
}

h1 {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

h2 {
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
}

h3 {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}


/* ===========================
   Layout
   =========================== */
.page-padding {
	padding: 16px 16px 100px;
	max-width: 1200px;
	margin: 0 auto;
}

.center-screen {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.panel {
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	background: var(--surface);
	border-radius: var(--radius-lg);
	padding: 20px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.panel-wide {
	max-width: 100%;
}


/* ===========================
   Top Bar / Header
   =========================== */
.top-bar {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.top-bar-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--text);
	display: flex;
	align-items: center;
	gap: 8px;
}

.top-bar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}


/* ===========================
   Theme Toggle
   =========================== */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-full);
	border: 1px solid var(--border);
	background: var(--surface-alt);
	cursor: pointer;
	font-size: 18px;
	transition: all var(--duration) var(--ease);
	color: var(--text-secondary);
	flex-shrink: 0;
}

.theme-toggle:hover {
	background: var(--primary-soft);
	border-color: var(--primary);
	color: var(--primary);
	transform: none;
	box-shadow: none;
}


/* ===========================
   Page Header
   =========================== */
.page-header {
	margin-bottom: 20px;
}

.page-header-content {
	display: grid;
	gap: 6px;
}

.page-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--text);
	line-height: 1.3;
}

.page-subtitle,
.page-note,
.muted,
.helper-text {
	color: var(--text-secondary);
	font-size: 14px;
	line-height: 1.6;
	margin: 0;
}

.helper-text {
	margin-bottom: 8px;
	font-size: 13px;
	color: var(--text-muted);
}


/* ===========================
   Buttons
   =========================== */
.button,
button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: var(--radius-sm);
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	color: var(--text-inverse);
	background: var(--primary);
	transition: all var(--duration) var(--ease);
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	white-space: nowrap;
}

.button:hover,
button:hover {
	background: var(--primary-hover);
	transform: none;
	box-shadow: none;
}

.button:active,
button:active {
	transform: scale(0.97);
}

.button.secondary,
button.secondary {
	background: var(--surface-alt);
	color: var(--text-secondary);
	border: 1px solid var(--border);
}

.button.secondary:hover,
button.secondary:hover {
	background: var(--surface-hover);
	border-color: var(--border-strong);
	color: var(--text);
}

.button.info,
button.info {
	background: var(--info);
}

.button.info:hover,
button.info:hover {
	background: var(--info-hover);
	color: var(--text-inverse);
}

.button.danger,
button.danger,
.danger-button {
	background: var(--danger);
}

.button.danger:hover,
button.danger:hover,
.danger-button:hover {
	background: var(--danger-hover);
}

.button.small,
button.small,
.small-button {
	padding: 8px 14px;
	font-size: 13px;
	border-radius: var(--radius-xs);
}

.button.icon-btn,
button.icon-btn {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: var(--radius-sm);
	font-size: 18px;
}

button:disabled,
.button:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	transform: none;
}

.button.ghost,
button.ghost {
	background: transparent;
	color: var(--text-secondary);
	border: none;
	padding: 8px;
}

.button.ghost:hover,
button.ghost:hover {
	background: var(--surface-alt);
	color: var(--text);
}


/* ===========================
   Floating Action Button
   =========================== */
.fab {
	position: fixed;
	bottom: calc(var(--bottom-nav-height) + 20px);
	left: 16px;
	width: 56px;
	height: 56px;
	border-radius: var(--radius-full);
	background: var(--primary);
	color: var(--text-inverse);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	box-shadow: var(--shadow-lg);
	z-index: 90;
	transition: all var(--duration) var(--ease);
	text-decoration: none;
	border: none;
	cursor: pointer;
}

.fab:hover {
	transform: scale(1.08);
	box-shadow: var(--shadow-lg);
	background: var(--primary-hover);
	color: var(--text-inverse);
}


/* ===========================
   Stats
   =========================== */
.stats-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}

.stat-box {
	padding: 14px 16px;
	border-radius: var(--radius-md);
	background: var(--surface-alt);
	border: 1px solid var(--border);
	text-align: center;
}

.stat-box strong {
	display: block;
	font-size: 26px;
	font-weight: 700;
	color: var(--primary);
	margin-bottom: 2px;
}

.stat-box .muted {
	font-size: 12px;
	margin: 0;
}


/* ===========================
   Action Bar (Quick links)
   =========================== */
.page-actions,
.actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}


/* ===========================
   Forms
   =========================== */
label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: var(--text);
}

.form-group {
	margin-bottom: 16px;
}

input,
textarea,
select {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-family: inherit;
	color: var(--text);
	background: var(--surface);
	margin-bottom: 14px;
	transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
	appearance: none;
	-webkit-appearance: none;
}

select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 14px center;
	padding-left: 36px;
}

input:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: var(--shadow-focus);
}

textarea {
	min-height: 110px;
	resize: vertical;
}

input[type="checkbox"] {
	width: auto;
	margin: 0;
	accent-color: var(--primary);
}

.form-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 4px;
}


/* ===========================
   Product Cards (Listing)
   =========================== */
.products {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.product-card,
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: box-shadow var(--duration) var(--ease),
		transform var(--duration) var(--ease);
}

.product-card:active {
	transform: scale(0.99);
}

.product-card img,
.card img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.product-card-body,
.card-body {
	padding: 16px;
}

.product-card h2,
.card h2 {
	font-size: 17px;
	margin-bottom: 6px;
}

.price {
	color: var(--accent);
	font-size: 20px;
	font-weight: 800;
	margin: 6px 0 8px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.category-badge {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: var(--radius-full);
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 8px;
}

.product-card p,
.card p {
	color: var(--text-secondary);
	font-size: 14px;
	line-height: 1.7;
}

.private-note-box {
	margin-top: 12px;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	background: var(--accent-soft);
	border: 1px solid var(--border);
}

.private-note-box strong {
	display: block;
	margin-bottom: 4px;
	color: var(--accent);
	font-size: 13px;
}


/* ===========================
   Card Actions (admin list)
   =========================== */
.card-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
	padding: 12px 16px;
	border-top: 1px solid var(--border);
	background: var(--surface-alt);
}


/* ===========================
   Admin Product List (card-based on mobile)
   =========================== */
.admin-product-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}

.admin-product-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: all var(--duration) var(--ease);
}

.admin-product-card-body {
	display: flex;
	gap: 12px;
	padding: 12px;
	align-items: flex-start;
}

.admin-product-card .media-thumb {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: var(--radius-xs);
	flex-shrink: 0;
}

.admin-product-card-info {
	flex: 1;
	min-width: 0;
}

.admin-product-card-info h3 {
	font-size: 15px;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.admin-product-card-info .price {
	font-size: 16px;
	margin: 2px 0 4px;
}

.admin-product-card-info .category-badge {
	font-size: 11px;
	padding: 3px 8px;
}

.admin-product-card-actions {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--border);
	background: var(--surface-alt);
}

.admin-product-card-actions .button,
.admin-product-card-actions button {
	flex: 1;
	font-size: 13px;
	padding: 9px 12px;
}


/* ===========================
   Tables (desktop fallback)
   =========================== */
.table-wrap {
	overflow-x: auto;
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	background: var(--surface);
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 12px;
	text-align: right;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
	font-size: 14px;
}

th {
	background: var(--surface-alt);
	color: var(--text-secondary);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.thumb,
.media-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: var(--radius-xs);
	display: block;
}


/* ===========================
   Section / Cards
   =========================== */
.section-box,
.role-card,
.table-card {
	margin-bottom: 16px;
	padding: 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.section-box h2,
.role-card h2,
.table-card h2 {
	margin-bottom: 12px;
}


/* ===========================
   Badges
   =========================== */
.badge,
.role-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	border-radius: var(--radius-full);
	background: var(--primary-soft);
	color: var(--primary);
	font-size: 13px;
	font-weight: 600;
}


/* ===========================
   Alerts / Messages
   =========================== */
.error {
	background: var(--danger-soft);
	color: var(--danger);
	border: 1px solid var(--danger);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 500;
}

.success {
	background: var(--success-soft);
	color: var(--success);
	border: 1px solid var(--success);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 500;
}


/* ===========================
   Hero (front page)
   =========================== */
.hero {
	border-radius: var(--radius-lg);
	background: linear-gradient(135deg, var(--primary), #1e40af);
	color: #ffffff;
	padding: 24px 20px;
	margin-bottom: 16px;
	box-shadow: var(--shadow-md);
	position: relative;
	overflow: hidden;
}

.hero::before {
	content: '';
	position: absolute;
	top: -30%;
	left: -30%;
	width: 80%;
	height: 80%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
	pointer-events: none;
}

.hero .page-title,
.hero h1,
.hero h2,
.hero p {
	color: #ffffff;
	position: relative;
}

.hero .page-title,
.hero h1 {
	font-size: 22px;
	margin-bottom: 6px;
}

.hero .page-note {
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	margin: 0;
}


/* ===========================
   Quick Nav / Category Filters
   =========================== */
.quick-nav {
	margin-bottom: 16px;
	padding: 16px;
	border-radius: var(--radius-md);
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
}

.quick-nav h2 {
	font-size: 16px;
	margin-bottom: 10px;
}

.quick-links {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.quick-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: var(--radius-full);
	text-decoration: none;
	background: var(--surface-alt);
	color: var(--text-secondary);
	font-weight: 600;
	font-size: 13px;
	border: 1px solid var(--border);
	transition: all var(--duration) var(--ease);
}

.quick-link:hover {
	background: var(--primary-soft);
	border-color: var(--primary);
	color: var(--primary);
}

.quick-link.active {
	background: var(--primary);
	color: var(--text-inverse);
	border-color: var(--primary);
}

.count {
	font-size: 12px;
	opacity: 0.7;
}

.sub-nav {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--border);
}

.sub-nav h3 {
	font-size: 14px;
	margin-bottom: 8px;
	color: var(--text-secondary);
}


/* ===========================
   Empty state
   =========================== */
.empty-text {
	padding: 24px;
	border: 2px dashed var(--border);
	border-radius: var(--radius-md);
	color: var(--text-muted);
	text-align: center;
	font-size: 14px;
}


/* ===========================
   Login
   =========================== */
.login-box {
	width: 100%;
	max-width: 400px;
}

.login-box .page-title {
	text-align: center;
	margin-bottom: 4px;
}

.login-box .helper-text {
	text-align: center;
	margin-bottom: 20px;
}

.login-box .button,
.login-box button {
	width: 100%;
}

.login-logo {
	text-align: center;
	font-size: 36px;
	margin-bottom: 12px;
}


/* ===========================
   Two-column / Grid layouts
   =========================== */
.grid {
	display: grid;
	gap: 16px;
}

.two-col {
	display: grid;
	gap: 16px;
}

.three-col {
	display: grid;
	gap: 12px;
}


/* ===========================
   Inline Forms (table edit)
   =========================== */
.inline-form {
	display: grid;
	gap: 10px;
}

.inline-form input,
.inline-form select {
	margin-bottom: 0;
}

.inline-form-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.inline-form-row input,
.inline-form-row select {
	flex: 1 1 160px;
	margin-bottom: 0;
}

.inline-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.inline-actions form {
	margin: 0;
}

.inline-edit-form {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	flex: 1 1 auto;
}

.inline-edit-form input,
.inline-edit-form select {
	flex: 1 1 140px;
	margin-bottom: 0;
}


/* ===========================
   Checkboxes / Permissions
   =========================== */
.checkbox-row,
.check-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface-alt);
	font-size: 14px;
	cursor: pointer;
	transition: all var(--duration) var(--ease);
}

.checkbox-row:hover,
.check-row:hover {
	border-color: var(--primary);
	background: var(--primary-soft);
}

.checkbox-row input,
.check-row input {
	width: auto;
	margin: 0;
}

.permission-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 8px;
	margin-top: 12px;
}

.permission-list {
	color: var(--text-secondary);
	font-size: 14px;
	margin-bottom: 12px;
}

.compact-form {
	max-width: 100%;
}


/* ===========================
   Bottom Navigation (Admin)
   =========================== */
.bottom-nav {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background: var(--surface);
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-around;
	align-items: stretch;
	padding: 0;
	height: var(--bottom-nav-height);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.bottom-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 11px;
	font-weight: 600;
	flex: 1;
	transition: color var(--duration) var(--ease);
	padding: 6px 4px;
}

.bottom-nav-item svg,
.bottom-nav-item .nav-icon {
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.bottom-nav-item.active {
	color: var(--primary);
}

.bottom-nav-item:hover {
	color: var(--primary);
}


/* ===========================
   Misc Utilities
   =========================== */
.top-box {
	display: grid;
	gap: 8px;
	margin-bottom: 16px;
}

.stack-sm {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.text-nowrap {
	white-space: nowrap;
}

.text-center {
	text-align: center;
}

.mt-sm {
	margin-top: 8px;
}

.mt-md {
	margin-top: 16px;
}

.mb-sm {
	margin-bottom: 8px;
}

.mb-md {
	margin-bottom: 16px;
}

.description-text {
	color: var(--text-secondary);
	font-size: 13px;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	box-orient: vertical;
	overflow: hidden;
}

.page-strip {
	display: grid;
	gap: 16px;
}

/* Checkboxes & Switches */
.checkbox-row, .check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    user-select: none;
    font-weight: 500;
}

.checkbox-row:hover, .check-row:hover {
    border-color: var(--primary-light);
    background: var(--surface);
    transform: translateY(-1px);
}

.checkbox-row input[type="checkbox"], 
.check-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-strong);
    border-radius: 8px; /* Slightly rounded square */
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: all 0.2s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
}

.checkbox-row input[type="checkbox"]:checked,
.check-row input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-row input[type="checkbox"]:checked::after,
.check-row input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 18px;
    font-weight: 900;
}

/* Role Permission Grid */
.permission-grid {
    display: grid;
    gap: 10px;
}

.desktop-nav {
	display: none;
}


/* ===========================
   Responsive — Tablet+
   =========================== */
@media (min-width: 640px) {
	.page-padding {
		padding: 24px 24px 40px;
	}

	.panel {
		padding: 28px;
	}

	h1,
	.page-title {
		font-size: 28px;
	}

	h2 {
		font-size: 21px;
	}

	.products {
		grid-template-columns: repeat(2, 1fr);
	}

	.admin-product-list {
		grid-template-columns: repeat(2, 1fr);
	}

	.two-col {
		grid-template-columns: repeat(2, 1fr);
	}

	.three-col {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}

	.permission-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.stats-row {
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	}

	.hero {
		padding: 32px 28px;
	}

	.hero .page-title,
	.hero h1 {
		font-size: 28px;
	}

	.page-actions .button,
	.page-actions button {
		width: auto;
	}

	.bottom-nav {
		display: none;
	}

	.desktop-nav {
		display: flex;
	}

	.fab {
		bottom: 24px;
	}

	.page-padding {
		padding-bottom: 40px;
	}

	.compact-form {
		max-width: 520px;
	}
}


/* ===========================
   Responsive — Desktop
   =========================== */
@media (min-width: 1024px) {
	.page-padding {
		padding: 32px 32px 48px;
	}

	.products {
		grid-template-columns: repeat(3, 1fr);
	}

	.admin-product-list {
		grid-template-columns: repeat(3, 1fr);
	}

	.card img,
	.product-card img {
		height: 220px;
	}

	.hero {
		padding: 40px 36px;
	}
}


/* ===========================
   Animations
   =========================== */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.product-card,
.card,
.admin-product-card,
.section-box,
.role-card {
	animation: fadeInUp 0.35s var(--ease) both;
}

.admin-product-card:nth-child(1) {
	animation-delay: 0s;
}

.admin-product-card:nth-child(2) {
	animation-delay: 0.04s;
}

.admin-product-card:nth-child(3) {
	animation-delay: 0.08s;
}

.admin-product-card:nth-child(4) {
	animation-delay: 0.12s;
}

.admin-product-card:nth-child(5) {
	animation-delay: 0.16s;
}

.admin-product-card:nth-child(6) {
	animation-delay: 0.20s;
}

.product-card:nth-child(1) {
	animation-delay: 0s;
}

.product-card:nth-child(2) {
	animation-delay: 0.04s;
}

.product-card:nth-child(3) {
	animation-delay: 0.08s;
}

.product-card:nth-child(4) {
	animation-delay: 0.12s;
}

.product-card:nth-child(5) {
	animation-delay: 0.16s;
}

.product-card:nth-child(6) {
	animation-delay: 0.20s;
}


/* ===========================
   Scrollbar styling
   =========================== */
::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: var(--border-strong);
	border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--text-muted);
}


/* ===========================
   Status indicator
   =========================== */
.status-active {
	color: var(--success);
	font-weight: 600;
}

.status-inactive {
	color: var(--danger);
	font-weight: 600;
}