/* ========================================
   GLOBAL CSS - PinStory App
   ======================================== */

:root {
	--font-base: 1.6rem;
	--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
	--font-family-headline: 'Poppins', 'Arial', sans-serif;

	--gray-300: #d1d5db;
	--gray-500: #6b7280;
	--gray-700: #374151;
	--pink-600: #db2777;
	--orange-500: #f97316;
	--indigo-600: #4f46e5;
	--black: #000000;
	--white: #ffffff;

	--brand: #c8493e;
	--brand-dark: #a03a2f;
	--brand-light: #fef2f2;

	--content-max-width: 1800px;

	--text-2xs: calc(var(--font-base) * 0.625);
	--text-xs:  calc(var(--font-base) * 0.75);
	--text-sm:  calc(var(--font-base) * 0.875);
	--text-base: calc(var(--font-base) * 1);
	--text-md:  calc(var(--font-base) * 1);
	--text-lg:  calc(var(--font-base) * 1.125);
	--text-xl:  calc(var(--font-base) * 1.25);
	--text-2xl: calc(var(--font-base) * 1.5);
	--text-3xl: calc(var(--font-base) * 1.75);
	--text-4xl: calc(var(--font-base) * 2);

	--padding-4xs: calc(var(--font-base) * 0.25);
	--padding-3xs: calc(var(--font-base) * 0.375);
	--padding-2xs: calc(var(--font-base) * 0.5);
	--padding-xs:  calc(var(--font-base) * 0.75);
	--padding-sm:  calc(var(--font-base) * 0.875);
	--padding-md:  calc(var(--font-base) * 1);
	--padding-lg:  calc(var(--font-base) * 1.25);
	--padding-xl:  calc(var(--font-base) * 1.5);
	--padding-2xl: calc(var(--font-base) * 2);
	--padding-3xl: calc(var(--font-base) * 2.5);
	--padding-4xl: calc(var(--font-base) * 3);

	--margin-4xs: calc(var(--font-base) * 0.25);
	--margin-3xs: calc(var(--font-base) * 0.375);
	--margin-2xs: calc(var(--font-base) * 0.5);
	--margin-xs:  calc(var(--font-base) * 0.75);
	--margin-sm:  calc(var(--font-base) * 0.875);
	--margin-md:  calc(var(--font-base) * 1);
	--margin-lg:  calc(var(--font-base) * 1.25);
	--margin-xl:  calc(var(--font-base) * 1.5);
	--margin-2xl: calc(var(--font-base) * 2);
	--margin-3xl: calc(var(--font-base) * 2.5);
	--margin-4xl: calc(var(--font-base) * 3);

	--padding-adaptive: calc(var(--font-base) * 1.25);
	--margin-adaptive:  calc(var(--font-base) * 1.25);
	--dimension-gap:    calc(var(--font-base) * 1);

	--label-font-size:      var(--text-2xs);
	--label-font-weight:    700;
	--label-text-transform: uppercase;
	--label-padding:        4px 6px;
	--label-border-radius:  4px;

	--button-padding:       var(--padding-md) var(--padding-lg);
	--button-font-size:     var(--text-base);
	--button-font-weight:   600;
	--button-border-radius: 4px;
	--button-transition:    all 200ms ease-in-out;

	--card-padding:      var(--padding-lg);
	--card-border-radius: 8px;
	--card-box-shadow:   0 1px 3px rgba(0,0,0,0.1);
	--card-background:   var(--white);

	--input-padding:       var(--padding-md);
	--input-border:        1px solid var(--gray-300);
	--input-border-radius: 4px;
	--input-font-size:     var(--text-base);
	--input-transition:    all 200ms ease-in-out;
}

/* ========================================
   RESET & BASE
   ======================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 62.5%; scroll-behavior: smooth; }

body {
	font-family: var(--font-family);
	font-size: var(--font-base);
	line-height: 1.6;
	color: var(--gray-700);
	background-color: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-family-headline);
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: var(--margin-md);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: var(--margin-md); }
a { color: var(--indigo-600); text-decoration: none; transition: color 200ms ease-in-out; }
a:hover { color: var(--pink-600); }

/* ========================================
   BUTTONS
   ======================================== */

button, .btn {
	padding: var(--button-padding);
	font-size: var(--button-font-size);
	font-weight: var(--button-font-weight);
	border: none;
	border-radius: var(--button-border-radius);
	cursor: pointer;
	transition: var(--button-transition);
	font-family: inherit;
}

.btn-primary   { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--gray-300); color: var(--gray-700); }
.btn-secondary:hover { background: #bfdbfe; }
.btn-success   { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger    { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 4px; }

/* ========================================
   FORMS
   ======================================== */

input, textarea, select {
	padding: var(--input-padding);
	border: var(--input-border);
	border-radius: var(--input-border-radius);
	font-size: var(--input-font-size);
	font-family: inherit;
	transition: var(--input-transition);
	width: 100%;
}
input:focus, textarea:focus, select:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(200,73,62,0.1);
}
label { display: block; margin-bottom: var(--margin-xs); font-weight: 600; font-size: var(--text-sm); }
.form-group { margin-bottom: var(--margin-lg); }

/* ========================================
   LAYOUT
   ======================================== */

.container { max-width: var(--content-max-width); margin: 0 auto; padding: 0 var(--padding-lg); }

/* ========================================
   ADMIN - SHARED COMPONENTS
   ======================================== */

/* Page header */
.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 40px;
	padding: var(--padding-lg) 0;
	border-bottom: 2px solid #e5e7eb;
}

/* Rack cards (admin index) */
.racks-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
}
.rack-card {
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	transition: all 300ms cubic-bezier(0.4,0,0.2,1);
}
.rack-card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(200,73,62,0.15); }
.rack-header { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: white; padding: 24px; }
.rack-name   { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.rack-desc   { font-size: 13px; opacity: 0.85; }
.rack-body   { padding: 20px; }
.rack-footer {
	display: flex; justify-content: space-between; align-items: center;
	padding-top: 16px; border-top: 1px solid #e5e7eb; gap: 8px; flex-wrap: wrap;
}
.positions-count { font-size: 12px; color: #999; flex: 1; }
.rack-actions { display: flex; gap: 8px; }
.position-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 4px; margin-bottom: 16px; }
.position-item {
	aspect-ratio: 1; background: #f3f4f6; border: 2px solid #e5e7eb; border-radius: 4px;
	display: flex; align-items: center; justify-content: center;
	font-size: 10px; font-weight: 700; color: #666; cursor: pointer; transition: all 150ms;
}
.position-item:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }

/* Admin rack action buttons */
.btn-edit      { background: var(--brand); color: white; }
.btn-edit:hover { background: var(--brand-dark); }
.btn-positions { background: var(--indigo-600); color: white; }
.btn-positions:hover { background: #4338ca; }
.btn-delete    { background: #ef4444; color: white; }
.btn-delete:hover { background: #dc2626; }

/* Modal */
.modal {
	position: fixed; top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	display: flex; align-items: flex-start; justify-content: center;
	z-index: 1000; padding: 40px 20px; overflow-y: auto;
	animation: fadeIn 200ms ease;
}
.modal.hidden { display: none !important; }
.modal-content {
	background: white; border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	max-width: 500px; width: 90%;
	animation: slideInUp 300ms ease;
}
.modal-large { max-width: 900px; max-height: 85vh; overflow-y: auto; }
.modal-header {
	padding: 24px;
	background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
	color: white; border-radius: 8px 8px 0 0;
}
.modal-header h3 { margin: 0; }
.modal-body   { padding: 24px; }
.modal-footer {
	padding: 16px 24px; background: #f9fafb;
	border-top: 1px solid #e5e7eb;
	display: flex; justify-content: space-between; gap: 12px;
	border-radius: 0 0 8px 8px;
}

/* Spinner */
.spinner {
	width: 32px; height: 32px;
	border: 3px solid #e5e7eb; border-top-color: var(--brand);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	display: inline-block;
}

/* Alerts */
.alert { padding: 16px; border-radius: 6px; margin-bottom: 20px; animation: slideInUp 300ms ease; }
.alert-error   { background: #fee2e2; color: var(--brand); border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }

/* History/Status */
.status-badge  { display: inline-block; padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.status-pending   { background: #fef3c7; color: #d97706; }
.status-submitted { background: #dbeafe; color: #0284c7; }
.status-packed    { background: #d1fae5; color: #059669; }
.status-shipped   { background: #e9d5ff; color: #7c3aed; }
.status-delivered { background: #dcfce7; color: #16a34a; }

/* ========================================
   APP DASHBOARD - CLIENT
   ======================================== */

/* Header */
.app-header {
	background: white;
	border-bottom: 3px solid var(--brand);
	position: sticky; top: 0; z-index: 100;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.app-header-inner {
	max-width: 1200px; margin: 0 auto; padding: 0 24px;
	height: 64px;
	display: flex; align-items: center; justify-content: space-between;
}
.app-logo {
	font-size: 22px; font-weight: 800; color: var(--brand);
	text-decoration: none; letter-spacing: -0.5px;
}
.app-header-right { display: flex; align-items: center; gap: 16px; }

.user-badge {
	display: flex; align-items: center; gap: 10px;
	padding: 6px 12px; background: #f9fafb; border-radius: 20px; font-size: 13px;
}
.user-badge .email { color: #555; font-weight: 600; }
.user-mode { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.mode-wholesale { background: #fef3c7; color: #b45309; }
.mode-retail    { background: #dbeafe; color: #1d4ed8; }

.cart-btn {
	position: relative;
	padding: 8px 16px; background: var(--brand); color: white;
	border: none; border-radius: 6px; cursor: pointer;
	font-weight: 700; font-size: 14px; transition: background 200ms;
}
.cart-btn:hover { background: var(--brand-dark); }
.cart-count {
	position: absolute; top: -6px; right: -6px;
	background: #1f1f1f; color: white;
	width: 18px; height: 18px; border-radius: 50%;
	font-size: 10px; font-weight: 800;
	display: flex; align-items: center; justify-content: center;
}

.logout-btn {
	padding: 8px 14px; background: #f3f4f6; color: #555;
	border: none; border-radius: 6px; cursor: pointer;
	font-size: 13px; font-weight: 600; transition: background 200ms;
}
.logout-btn:hover { background: #e5e7eb; }

/* Tabs */
.app-tabs-bar {
	background: white; border-bottom: 1px solid #e5e7eb;
	max-width: 1200px; margin: 0 auto; padding: 0 24px;
	display: flex;
}
.app-tab-btn {
	padding: 14px 20px;
	background: none; border: none; border-bottom: 3px solid transparent;
	cursor: pointer; font-size: 14px; font-weight: 600; color: #999;
	transition: all 200ms; margin-bottom: -1px;
}
.app-tab-btn:hover { color: var(--brand); }
.app-tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.app-tab-panel { display: none; }
.app-tab-panel.active { display: block; }

/* Main wrapper */
.app-main { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }

/* Racks grid (client) */
.client-racks-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 20px;
}
.client-rack-card {
	background: white; border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	overflow: hidden; transition: all 250ms;
}
.client-rack-card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,0.12); }
.client-rack-header {
	background: linear-gradient(135deg, var(--brand), var(--brand-dark));
	color: white; padding: 18px 20px;
}
.client-rack-header h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.client-rack-header p  { font-size: 12px; opacity: 0.8; margin: 0; }
.client-rack-body   { padding: 16px 20px; }
.client-rack-footer {
	display: flex; justify-content: space-between; align-items: center;
	padding-top: 12px; border-top: 1px solid #f0f0f0; margin-top: 12px;
}
.client-rack-footer span { font-size: 12px; color: #999; }

/* Mini positions preview */
.positions-mini-grid { display: grid; gap: 4px; margin-bottom: 12px; }
.pos-mini {
	aspect-ratio: 1; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 4px;
	cursor: pointer; position: relative; overflow: hidden;
	display: flex; align-items: flex-end; justify-content: center;
	font-size: 9px; font-weight: 700; color: #bbb; padding-bottom: 2px;
	transition: all 150ms;
}
.pos-mini.empty { border-style: dashed; opacity: 0.4; cursor: default; }
.pos-mini:not(.empty):hover { border-color: var(--brand); transform: scale(1.08); z-index: 1; }
.pos-mini img { position: absolute; top: 0; left: 0; width: 100%; height: 80%; object-fit: cover; }
.pos-mini span { position: relative; z-index: 1; }

.btn-browse {
	padding: 8px 16px; background: var(--brand); color: white;
	border: none; border-radius: 5px; cursor: pointer;
	font-size: 13px; font-weight: 700; transition: background 200ms;
}
.btn-browse:hover { background: var(--brand-dark); }

/* Rack detail */
.rack-detail-wrap {
	display: none;
	background: white; border-radius: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden;
}
.rack-detail-header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 18px 24px; border-bottom: 1px solid #e5e7eb;
}
.rack-detail-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.rack-detail-header p  { font-size: 13px; color: #999; margin: 4px 0 0 0; }
.btn-back {
	padding: 8px 14px; background: #f3f4f6; color: #555;
	border: none; border-radius: 5px; cursor: pointer;
	font-size: 13px; font-weight: 600; transition: background 200ms;
	white-space: nowrap;
}
.btn-back:hover { background: #e5e7eb; }
.rack-detail-grid { padding: 24px; overflow-x: auto; }
.positions-full-grid { display: grid; gap: 10px; width: fit-content; margin: 0 auto; }

/* Full position boxes */
.pos-full {
	width: 90px; height: 90px;
	background: white; border: 2px solid #e5e7eb; border-radius: 8px;
	overflow: hidden; position: relative;
	display: flex; flex-direction: column;
	transition: all 180ms;
}
.pos-full.has-product {
	cursor: pointer;
}
.pos-full.has-product:hover {
	border-color: var(--brand);
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(200,73,62,0.2);
	z-index: 2;
}
.pos-full.empty {
	border-style: dashed; border-color: #d1d5db;
	background: #fafafa; cursor: not-allowed; opacity: 0.45;
}
.pos-full.added {
	border-color: #10b981; border-style: solid; background: #f0fdf4;
}
.pos-full img { width: 100%; height: 70px; object-fit: cover; }
.pos-full .pos-label {
	height: 20px; background: #f9fafb;
	display: flex; align-items: center; justify-content: center;
	font-size: 10px; font-weight: 800; color: #888; flex-shrink: 0;
}
.pos-full.empty .pos-label { color: #ccc; }
.pos-full.added .pos-label { background: #dcfce7; color: #16a34a; }
.pos-full .empty-dash {
	flex: 1; display: flex; align-items: center; justify-content: center;
	font-size: 20px; color: #d1d5db;
}
.added-badge {
	display: none; position: absolute; top: 3px; right: 3px;
	background: #10b981; color: white; border-radius: 50%;
	width: 18px; height: 18px; font-size: 10px;
	align-items: center; justify-content: center; font-weight: 800;
}
.pos-full.added .added-badge { display: flex; }

/* Global Popup */
.global-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    z-index: 1001;
    width: 320px;
    padding: 24px;
    animation: popupFadeIn 180ms ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.global-popup.active { display: block; }
.global-popup-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.global-popup-label  { font-size: 10px; color: #999; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.global-popup-name   { font-weight: 700; color: #333; font-size: 15px; line-height: 1.3; }
.global-popup-close  { background: none; border: none; font-size: 24px; color: #999; cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0; }
.global-popup-close:hover { color: #333; }
.global-popup-img    { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 16px; background: #f0f0f0; display: block; }
.global-popup-price-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: #fef2f2; border-radius: 8px; margin-bottom: 16px;
}
.global-popup-price-label { font-size: 11px; color: #999; margin-bottom: 2px; }
.global-popup-price  { font-size: 22px; font-weight: 800; color: var(--brand); }
.global-popup-total  { font-size: 18px; font-weight: 800; color: #333; }
.global-popup-qty    { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.global-popup-qty-btn {
    width: 40px; height: 40px; background: #f3f4f6; border: none; border-radius: 8px;
    font-size: 22px; font-weight: 700; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 150ms;
}
.global-popup-qty-btn:hover { background: #e5e7eb; }
.global-popup-qty-val { flex: 1; text-align: center; font-size: 26px; font-weight: 800; color: #333; }
.global-popup-add-btn {
    width: 100%; padding: 14px; background: var(--brand); color: white;
    border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background 200ms;
}
.global-popup-add-btn:hover { background: var(--brand-dark); }

.popup-overlay {
    display: none; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45); z-index: 1000;
}
.popup-overlay.active { display: block; }

/* Cart */
.cart-wrap { background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; }
.cart-empty-state { padding: 80px 20px; text-align: center; color: #999; }
.cart-empty-state .icon { font-size: 52px; margin-bottom: 16px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
	padding: 14px 16px; text-align: left;
	font-size: 12px; color: #666; font-weight: 700; text-transform: uppercase;
	background: #f9fafb; border-bottom: 2px solid #e5e7eb;
}
.cart-table td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.qty-input {
	width: 60px; padding: 6px 8px; border: 2px solid #e5e7eb; border-radius: 5px;
	text-align: center; font-weight: 700;
}
.btn-remove {
	background: none; border: none; color: #ef4444; cursor: pointer;
	font-size: 20px; padding: 4px 8px; border-radius: 4px; line-height: 1;
	transition: background 200ms;
}
.btn-remove:hover { background: #fee2e2; }
.cart-footer {
	padding: 20px 24px; background: #f9fafb; border-top: 2px solid #e5e7eb;
	display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.cart-total { font-size: 22px; font-weight: 800; color: #333; }
.cart-total span { font-size: 14px; color: #999; font-weight: 400; margin-right: 6px; }
.btn-order {
	padding: 12px 32px; background: var(--brand); color: white;
	border: none; border-radius: 7px; font-size: 15px; font-weight: 700;
	cursor: pointer; transition: all 200ms;
}
.btn-order:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(200,73,62,0.3); }

/* History */
.history-wrap { background: white; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table th {
	padding: 14px 16px; text-align: left;
	font-size: 12px; color: #666; font-weight: 700; text-transform: uppercase;
	background: #f9fafb; border-bottom: 2px solid #e5e7eb;
}
.history-table td { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.status-pill { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.s-pending   { background: #fef3c7; color: #b45309; }
.s-submitted { background: #dbeafe; color: #1d4ed8; }
.s-packed    { background: #d1fae5; color: #059669; }
.s-shipped   { background: #e9d5ff; color: #7c3aed; }
.s-delivered { background: #dcfce7; color: #16a34a; }

/* Toast */
.toast {
	position: fixed; bottom: 24px; right: 24px;
	padding: 12px 20px; border-radius: 8px;
	color: white; font-weight: 600; font-size: 14px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	z-index: 9999; animation: slideInUp 300ms ease;
}
.toast-success { background: #1f1f1f; }
.toast-error   { background: #ef4444; }

/* ========================================
   ADMIN GLOBAL
   ======================================== */

/* Admin header */
header.admin-header {
	background: white;
	border-bottom: 2px solid var(--brand);
	padding: 20px 0;
	position: sticky; top: 0; z-index: 100;
	box-shadow: 0 2px 8px rgba(200,73,62,0.08);
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */

.card {
	background: var(--card-background);
	padding: var(--card-padding);
	border-radius: var(--card-border-radius);
	box-shadow: var(--card-box-shadow);
	transition: var(--button-transition);
}
.card:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.card-header { padding-bottom: var(--padding-md); border-bottom: 1px solid var(--gray-300); margin-bottom: var(--margin-md); }
.card-body   { padding: var(--padding-md) 0; }
.card-footer { padding-top: var(--padding-md); border-top: 1px solid var(--gray-300); margin-top: var(--margin-md); }

/* Badges */
.badge { display: inline-block; padding: var(--label-padding); font-size: var(--label-font-size); font-weight: var(--label-font-weight); text-transform: var(--label-text-transform); border-radius: var(--label-border-radius); white-space: nowrap; }
.badge-primary { background: var(--indigo-600); color: white; }
.badge-success { background: #10b981; color: white; }
.badge-warning { background: #f59e0b; color: white; }
.badge-danger  { background: #ef4444; color: white; }

/* ========================================
   UTILITIES
   ======================================== */

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-danger { color: #ef4444; }
.text-success { color: #10b981; }
.font-bold    { font-weight: 700; }
.hidden       { display: none !important; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--margin-md); }
.gap-3 { gap: var(--margin-lg); }
.mt-4  { margin-top: 30px; }
.mb-4  { margin-bottom: 30px; }

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin      { to { transform: rotate(360deg); } }

.fade-in    { animation: fadeIn 300ms ease-in-out; }
.slide-in-up { animation: slideInUp 300ms ease-in-out; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
	:root {
		--padding-adaptive: calc(var(--font-base) * 0.75);
		--margin-adaptive:  calc(var(--font-base) * 0.75);
		--dimension-gap:    calc(var(--font-base) * 0.75);
	}
	body { font-size: 1.4rem; }
	h1 { font-size: var(--text-3xl); }
	h2 { font-size: var(--text-2xl); }
	.app-header-inner { padding: 0 16px; }
	.app-main { padding: 16px; }
	.client-racks-grid { grid-template-columns: 1fr; }
	.cart-footer { flex-direction: column; }
}

@media (min-width: 1024px) {
	:root {
		--padding-adaptive: calc(var(--font-base) * 1);
		--margin-adaptive:  calc(var(--font-base) * 1);
		--dimension-gap:    calc(var(--font-base) * 1.5);
	}
}

@media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}