/* ============================================
   KMK TRADING CORPORATION - COMPLETE STYLES
   Enhanced Edition — Lively & Professional
   ============================================ */

/* ============================================
   CSS VARIABLES (Design System)
   ============================================ */
:root {
    /* Primary Palette — richer, more sophisticated blue */
    --primary-50:  #e3f2fd;
    --primary-100: #bbdefb;
    --primary-200: #90caf9;
    --primary-300: #64b5f6;
    --primary-400: #42a5f5;
    --primary-500: #2196f3;
    --primary-600: #1e88e5;
    --primary-700: #1976d2;
    --primary-800: #1565c0;
    --primary-900: #0d47a1;

    /* Accent Colors */
    --accent-green:  #10b981;
    --accent-orange: #f59e0b;
    --accent-red:    #ef4444;
    --accent-purple: #8b5cf6;

    /* Neutrals */
    --gray-50:  #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Shadows — layered for depth */
    --shadow-sm:  0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.03);
    --shadow-glow: 0 0 20px rgb(30 144 255 / 0.15);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--primary-700);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-900);
}

/* ============================================
   ADMIN/OWNER/MANAGER LAYOUT
   ============================================ */

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────── */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-900) 0%, var(--primary-800) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.1);
}

.sidebar-header h3 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-header p {
    font-size: 0.7rem;
    opacity: 0.7;
    margin: 0.35rem 0 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.logo-img {
    max-width: 56px;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.sidebar-user p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-user .user-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-green);
}

.sidebar ul {
    list-style: none;
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar ul li {
    margin: 0.25rem 0.75rem;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.sidebar ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-400);
    border-radius: 0 4px 4px 0;
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.sidebar ul li a:hover,
.sidebar ul li a.active {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(2px);
}

.sidebar ul li a.active::before,
.sidebar ul li a:hover::before {
    transform: scaleY(1);
}

.sidebar ul li a.active {
    background: rgba(255,255,255,0.12);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.sidebar-footer a:hover {
    color: white;
    transform: translateX(2px);
}

/* ── Main Content ───────────────────────── */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
}

/* ── Page Header ────────────────────────── */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    color: var(--gray-900);
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header p {
    color: var(--gray-500);
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
}

/* ── Dashboard Cards ────────────────────── */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.card {
    background: white;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:nth-child(2)::before {
    background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
}

.card:nth-child(4)::before {
    background: linear-gradient(90deg, var(--accent-red), #f87171);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.card .number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-700);
    margin: 0.5rem 0 1.25rem;
    letter-spacing: -0.03em;
}

.card:nth-child(2) .number {
    color: var(--accent-green);
}

.card:nth-child(3) .number {
    color: var(--accent-orange);
}

.card:nth-child(4) .number {
    color: var(--accent-red);
}

.card p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.card a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgb(30 144 255 / 0.25);
}

.card:nth-child(2) a {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    box-shadow: 0 2px 8px rgb(16 185 129 / 0.25);
}

.card:nth-child(3) a {
    background: linear-gradient(135deg, var(--accent-orange), #d97706);
    box-shadow: 0 2px 8px rgb(245 158 11 / 0.25);
}

.card:nth-child(4) a {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    box-shadow: 0 2px 8px rgb(239 68 68 / 0.25);
}

.card a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgb(30 144 255 / 0.35);
    filter: brightness(1.05);
}

/* Low Stock Alert special styling */
.card.alert-card {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
    border: 1px solid #fed7aa;
}

.card.alert-card::before {
    background: linear-gradient(90deg, var(--accent-red), #f87171);
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-body {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 50%, #0c4a6e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
    width: 100%;
    max-width: 420px;
    margin: 2rem;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--gray-900);
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.login-header .subtitle {
    color: var(--gray-400);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.login-header .tagline {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
    transition: all var(--transition-fast);
    color: var(--gray-800);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.login-form input::placeholder {
    color: var(--gray-400);
}

.login-form button {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgb(30 144 255 / 0.3);
    margin-top: 0.5rem;
}

.login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgb(30 144 255 / 0.4);
    filter: brightness(1.05);
}

.login-form button:active {
    transform: translateY(0);
}

.login-links {
    text-align: center;
    margin-top: 1.5rem;
}

.login-links a {
    color: var(--primary-600);
    font-size: 0.9rem;
    font-weight: 500;
}

.register-prompt {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.register-prompt p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.register-prompt a {
    color: var(--primary-600);
    font-weight: 600;
}

/* ============================================
   PUBLIC PAGES
   ============================================ */

.public-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-800), var(--primary-900));
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.public-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    position: relative;
}

.public-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: white;
    transition: width var(--transition-normal);
    border-radius: 2px;
}

.public-nav a:hover {
    color: white;
}

.public-nav a:hover::after {
    width: 100%;
}

.nav-brand a {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    margin-left: 0;
}

.nav-brand a::after {
    display: none;
}

.nav-brand strong {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-brand span {
    font-size: 0.7rem;
    opacity: 0.8;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
}

.public-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ── Hero ───────────────────────────────── */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-900) 50%, #0c4a6e 100%);
    color: white;
    border-radius: var(--radius-xl);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.85;
    line-height: 1.7;
    position: relative;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: 0 4px 14px rgb(30 144 255 / 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(30 144 255 / 0.45);
    filter: brightness(1.05);
    color: white;
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-outline {
    background: transparent;
    color: var(--primary-700);
    border: 2px solid var(--primary-200);
}

.btn-outline:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
    color: var(--primary-800);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgb(239 68 68 / 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(239 68 68 / 0.4);
    color: white;
}

/* ── Product Grid ───────────────────────── */
.featured-products {
    margin-bottom: 3rem;
}

.featured-products h2 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.featured-products > p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-100);
    transition: all var(--transition-normal);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.product-card:hover::after {
    transform: scaleX(1);
}

.product-image {
    height: 220px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image .ar-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
}

.no-image {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.product-info {
    padding: 1.25rem;
}

.product-info h3 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
    color: var(--gray-900);
    font-weight: 600;
}

.category {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.price {
    color: var(--primary-700);
    font-weight: 800;
    font-size: 1.25rem;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.product-info .btn {
    width: 100%;
    justify-content: center;
}

/* ── AR Highlight ───────────────────────── */
.ar-highlight {
    background: linear-gradient(135deg, var(--primary-50) 0%, #eff6ff 100%);
    padding: 3.5rem 2rem;
    border-radius: var(--radius-xl);
    text-align: center;
    margin-top: 3rem;
    border: 1px solid var(--primary-100);
    position: relative;
    overflow: hidden;
}

.ar-highlight::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-200) 0%, transparent 70%);
    opacity: 0.3;
    border-radius: 50%;
}

.ar-highlight h2 {
    color: var(--primary-900);
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    position: relative;
}

.ar-highlight p {
    color: var(--gray-600);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    position: relative;
}

/* ── Search Bar ─────────────────────────── */
.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.search-bar input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--gray-50);
    transition: all var(--transition-fast);
}

.search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-400);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-100);
}

.search-bar select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 160px;
}

.search-bar select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* ── Product Detail ─────────────────────── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
    }
}

.main-image {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
}

.main-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.thumbnail-list {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.thumbnail:hover {
    border-color: var(--primary-500);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.detail-category {
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-price {
    font-size: 2rem;
    color: var(--primary-700);
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.detail-specs {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.detail-specs p {
    margin-bottom: 0.6rem;
    color: var(--gray-600);
}

.detail-specs strong {
    color: var(--gray-800);
    font-weight: 600;
}

.detail-description {
    margin-bottom: 1.5rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.ar-section {
    background: linear-gradient(135deg, var(--primary-50), #eff6ff);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    border: 1px solid var(--primary-100);
}

.ar-section h3 {
    color: var(--primary-900);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ar-locked {
    text-align: center;
    padding: 2rem;
}

.ar-locked p {
    color: var(--gray-500);
    margin-bottom: 1rem;
}

model-viewer {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
}

/* ============================================
   SHARED COMPONENTS
   ============================================ */

/* ── Forms ──────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
    transition: all var(--transition-fast);
    color: var(--gray-800);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

/* ── Tables ─────────────────────────────── */
.table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.table th,
.table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th {
    background: linear-gradient(180deg, var(--gray-50), var(--gray-100));
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--primary-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Flash/Alert Messages ───────────────── */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-left-color: #2e7d32;
}

.alert-error,
.alert-danger {
    background: #ffebee;
    color: #b71c1c;
    border-left-color: #c62828;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ── Status Badges ──────────────────────── */
.status-badge {
    padding: 0.35rem 0.875rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-pending-downpayment { background: #fff7ed; color: #c2410c; }
.status-pending-downpayment::before { background: #f97316; }

.status-confirmed { background: #eff6ff; color: #1d4ed8; }
.status-confirmed::before { background: #3b82f6; }

.status-in-production { background: #f3e8ff; color: #7e22ce; }
.status-in-production::before { background: #a855f7; }

.status-ready-for-delivery { background: #ecfdf5; color: #15803d; }
.status-ready-for-delivery::before { background: #22c55e; }

.status-delivered { background: #ecfeff; color: #0e7490; }
.status-delivered::before { background: #06b6d4; }

.status-completed { background: #ecfdf5; color: #15803d; }
.status-completed::before { background: #22c55e; }

.status-cancelled { background: #fef2f2; color: #b91c1c; }
.status-cancelled::before { background: #ef4444; }

.status-active { background: #ecfdf5; color: #15803d; }
.status-active::before { background: #22c55e; }

.status-inactive { background: #f3f4f6; color: #6b7280; }
.status-inactive::before { background: #9ca3af; }

.status-low { background: #fff7ed; color: #c2410c; }
.status-low::before { background: #f97316; }

/* ── Section Headers ────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

/* ── Pagination ─────────────────────────── */
.pagination {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.pagination a {
    background: white;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.pagination a:hover {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-300);
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: 0 2px 8px rgb(30 144 255 / 0.3);
}

/* ── Modal / Dialog ─────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.modal p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* ============================================
   FOOTER
   ============================================ */

.public-footer {
    text-align: center;
    padding: 2.5rem;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-200);
    margin-top: 4rem;
    background: white;
    font-size: 0.9rem;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fade-in {
    animation: fadeInUp 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease-out forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        min-height: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
    
    .wrapper {
        flex-direction: column;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .public-nav {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links a {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar input,
    .search-bar select {
        width: 100%;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-primary { color: var(--primary-700); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-orange); }
.text-danger { color: var(--accent-red); }
.text-muted { color: var(--gray-500); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================
   REGISTRATION PAGE FIX
   ============================================ */

/* The register page should use the same centered layout as login */
body.login-page,
body.register-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-900));
    padding: 2rem;
}

.login-container,
.register-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* If your register page wraps the form differently, force center */
.register-page form,
.login-page form {
    width: 100%;
}

/* ============================================
   APP-LAYOUT FIX (Customer Dashboard)
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-layout .sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    background: linear-gradient(180deg, var(--primary-900) 0%, var(--primary-800) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.app-layout .main-content,
.app-layout main,
.app-layout .content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
}

/* Force sidebar nav to stack vertically in app-layout */
.app-layout .sidebar ul,
.app-layout .sidebar nav ul {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    list-style: none !important;
    padding: 0.5rem 0 !important;
    margin: 0 !important;
}

.app-layout .sidebar ul li {
    display: block !important;
    width: 100% !important;
    margin: 0.1rem 0 !important;
}

.app-layout .sidebar ul li a {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1.5rem !important;
    color: rgba(255,255,255,0.75) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    margin: 0 0.75rem !important;
}

.app-layout .sidebar ul li a i {
    width: 20px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.app-layout .sidebar ul li a:hover,
.app-layout .sidebar ul li a.active {
    background: rgba(255,255,255,0.1) !important;
    color: white !important;
}

.app-layout .sidebar-footer {
    padding: 1.25rem 1.5rem !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    margin-top: auto !important;
}

/* Action buttons in products table */
.btn-stock {
    background: #17a2b8;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.2rem;
}
.btn-stock:hover {
    background: #138496;
}

.btn-edit {
    background: #007bff;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.2rem;
}
.btn-edit:hover {
    background: #0056b3;
}

.btn-deactivate {
    background: #dc3545;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.2rem;
}
.btn-deactivate:hover {
    background: #c82333;
}

.btn-delete {
    background: #6c757d;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.2rem;
}
.btn-delete:hover {
    background: #5a6268;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}
/* ============================================
   BUTTON STYLES — Fixed for visibility
   ============================================ */

.btn {
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-small {
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
}

/* View button — light gray with dark text */
.btn-view {
    background-color: #f3f4f6;
    color: #4b5563 !important;
    border: 1px solid #e5e7eb;
}

.btn-view:hover {
    background-color: #e5e7eb;
    color: #1f2937 !important;
}

/* Edit button — blue with white text (HIGH CONTRAST) */
.btn-edit {
    background-color: #2563eb;
    color: #ffffff !important;
    border: none;
}

.btn-edit:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Secondary button — fixed, visible */
.btn-secondary {
    background-color: #e5e7eb;
    color: #374151 !important;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background-color: #d1d5db;
    color: #1f2937 !important;
}

/* Primary button */
.btn-primary {
    background-color: #059669;
    color: #ffffff !important;
    border: none;
}

.btn-primary:hover {
    background-color: #047857;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 1rem;
}

.nav-icon i {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    display: inline-block;
}