:root {
    --mutesh-blue: #0A3298;
    --mutesh-blue-dark: #061F63;
    --mutesh-yellow: #FFCB05;
    --mutesh-yellow-hover: #e0b000;
    --mutesh-bg-light: #F4F6F9;
    --text-dark: #1E293B;
    --text-muted: #64748B;
    --white: #fff;
    --border-color: #E2E8F0;
    --danger: #DC2626;
    --success: #16A34A;
    --warn: #D97706;
}
* { margin:0; padding:0; box-sizing:border-box; font-family:'Poppins',sans-serif; }
body { background:var(--mutesh-bg-light); color:var(--text-dark); line-height:1.6; }
a { text-decoration:none; color:inherit; }
.container { max-width:1280px; margin:0 auto; padding:0 20px; }
ul { list-style:none; }

/* top bar */
.top-bar { background:var(--mutesh-blue-dark); color:#fff; font-size:.85rem; padding:8px 0; border-bottom:3px solid var(--mutesh-yellow); }
.top-bar .container { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.top-bar-info span { margin-right:20px; }
.top-bar-info i { color:var(--mutesh-yellow); margin-right:6px; }
.top-bar-links a { color:#fff; margin-left:15px; transition:color .2s; }
.top-bar-links a:hover { color:var(--mutesh-yellow); }

/* header */
.site-header { background:#fff; box-shadow:0 4px 12px rgba(0,0,0,.08); position:sticky; top:0; z-index:1000; }
.header-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:14px 20px; flex-wrap:wrap; }
.logo { display:flex; align-items:center; gap:12px; }
.logo-icon { width:44px; height:44px; background:var(--mutesh-blue); border:3px solid var(--mutesh-yellow); border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--mutesh-yellow); font-size:1.4rem; font-weight:800; }
.logo-text h1 { font-size:1.2rem; font-weight:800; color:var(--mutesh-blue); line-height:1.1; text-transform:uppercase; }
.logo-text span { font-size:.7rem; color:var(--mutesh-yellow-hover); font-weight:700; letter-spacing:1px; display:block; }
.main-nav { background:#fff; border-top:1px solid var(--border-color); }
.main-nav .nav-links { display:flex; align-items:center; gap:2px; flex-wrap:wrap; padding:0 4px; }
.main-nav .nav-links a { display:flex; align-items:center; gap:6px; padding:12px 16px; color:var(--text-dark); font-weight:600; font-size:.85rem; text-transform:uppercase; border-radius:0; transition:all .2s; position:relative; }
.main-nav .nav-links a:hover { color:var(--mutesh-blue); }
.main-nav .nav-links a:hover::after { content:''; position:absolute; left:16px; right:16px; bottom:0; height:3px; background:var(--mutesh-yellow); border-radius:3px 3px 0 0; }
.main-nav .nav-links .nav-admin a { color:var(--mutesh-blue); font-weight:700; }
.header-actions { display:flex; align-items:center; gap:14px; }
.header-account { display:flex; align-items:center; gap:14px; }
.account-name { font-weight:600; font-size:.9rem; }
.role-badge { font-size:.65rem; padding:2px 8px; border-radius:20px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; margin-left:6px; }
.role-super_admin { background:#FACC15; color:#000; }
.role-admin { background:var(--mutesh-blue); color:#fff; }
.role-agent { background:#10B981; color:#fff; }
.role-customer { background:#94A3B8; color:#fff; }
.btn-ghost { background:transparent; border:1px solid var(--border-color); padding:8px 16px; border-radius:6px; font-weight:600; font-size:.85rem; cursor:pointer; color:var(--text-dark); }
.btn-ghost:hover { background:var(--mutesh-bg-light); }
.btn-yellow { background:var(--mutesh-yellow); color:var(--mutesh-blue-dark); padding:8px 16px; border-radius:6px; font-weight:700; font-size:.85rem; border:none; cursor:pointer; }
.btn-yellow:hover { background:var(--mutesh-yellow-hover); }
.btn-blue { background:var(--mutesh-blue); color:#fff; padding:8px 16px; border-radius:6px; font-weight:700; font-size:.85rem; border:none; cursor:pointer; }
.btn-blue:hover { background:var(--mutesh-blue-dark); }
.btn-danger { background:var(--danger); color:#fff; padding:6px 12px; border-radius:6px; font-weight:600; font-size:.8rem; border:none; cursor:pointer; }

/* content */
.page-content { padding:30px 20px; min-height:60vh; }
.page-title { font-size:1.6rem; font-weight:800; color:var(--mutesh-blue); text-transform:uppercase; margin-bottom:6px; }
.page-sub { color:var(--text-muted); margin-bottom:24px; }

/* flash */
.flash-wrap { margin-bottom:18px; }
.flash { padding:12px 16px; border-radius:8px; margin-bottom:10px; font-weight:500; font-size:.9rem; border:1px solid transparent; }
.flash-success { background:#DCFCE7; color:#166534; border-color:#BBF7D0; }
.flash-danger { background:#FEE2E2; color:#991B1B; border-color:#FECACA; }
.flash-warning { background:#FEF3C7; color:#92400E; border-color:#FDE68A; }
.flash-info { background:#E0E7FF; color:#3730A3; border-color:#C7D2FE; }

/* cards / grid */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:18px; margin-bottom:30px; }
.stat-card { background:#fff; border-radius:10px; padding:20px; border:1px solid var(--border-color); box-shadow:0 2px 6px rgba(0,0,0,.04); }
.stat-card .stat-num { font-size:2rem; font-weight:800; color:var(--mutesh-blue); }
.stat-card .stat-lbl { font-size:.8rem; text-transform:uppercase; color:var(--text-muted); font-weight:600; }
.stat-card i { color:var(--mutesh-yellow-hover); }

.card { background:#fff; border:1px solid var(--border-color); border-radius:10px; padding:20px; margin-bottom:24px; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.card h3 { font-size:1.1rem; color:var(--mutesh-blue); margin-bottom:14px; border-bottom:2px solid var(--mutesh-blue); padding-bottom:8px; text-transform:uppercase; }

/* tables */
.table { width:100%; border-collapse:collapse; background:#fff; border-radius:10px; overflow:hidden; border:1px solid var(--border-color); }
.table th, .table td { padding:12px 14px; text-align:left; font-size:.88rem; border-bottom:1px solid var(--border-color); }
.table th { background:var(--mutesh-bg-light); font-weight:700; color:var(--mutesh-blue); text-transform:uppercase; font-size:.75rem; letter-spacing:.5px; }
.table tr:hover td { background:#FAFBFF; }
.table .thumb img { width:54px; height:54px; object-fit:cover; border-radius:6px; border:1px solid var(--border-color); }

/* forms */
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid .full { grid-column:1/-1; }
.field { margin-bottom:14px; }
.field label { display:block; font-weight:600; font-size:.85rem; margin-bottom:6px; color:var(--text-dark); }
.field input, .field select, .field textarea { width:100%; padding:10px 12px; border:1px solid var(--border-color); border-radius:8px; font-size:.92rem; font-family:inherit; }
.field input:focus, .field select:focus, .field textarea:focus { outline:none; border-color:var(--mutesh-blue); box-shadow:0 0 0 3px rgba(10,50,152,.1); }
.field textarea { min-height:90px; }
.field .hint { font-size:.75rem; color:var(--text-muted); margin-top:4px; }
.form-errors { color:var(--danger); font-size:.8rem; margin-top:4px; }

.btn-row { display:flex; gap:12px; margin-top:8px; }

/* product images grid */
.img-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; margin-top:12px; }
.img-card { position:relative; border:1px solid var(--border-color); border-radius:8px; overflow:hidden; }
.img-card img { width:100%; height:120px; object-fit:cover; display:block; }
.img-card .primary-flag { position:absolute; top:6px; left:6px; background:var(--success); color:#fff; font-size:.65rem; padding:2px 8px; border-radius:4px; font-weight:700; }
.img-card .img-actions { display:flex; gap:6px; padding:6px; justify-content:space-between; }
.img-card .img-actions form { display:inline; }
.img-card .img-actions button { font-size:.72rem; padding:4px 8px; border:none; border-radius:5px; cursor:pointer; font-weight:600; }
.img-card .set-primary { background:var(--mutesh-blue); color:#fff; }
.img-card .del { background:var(--danger); color:#fff; }

/* variation table */
.variation-list { margin-top:10px; }
.variation-empty { color:var(--text-muted); font-style:italic; padding:10px 0; }

/* auth pages */
.auth-wrap { max-width:440px; margin:40px auto; }
.auth-card { background:#fff; border:1px solid var(--border-color); border-radius:12px; padding:30px; box-shadow:0 10px 25px rgba(0,0,0,.06); }
.auth-card h2 { color:var(--mutesh-blue); text-transform:uppercase; margin-bottom:6px; }
.auth-card .auth-sub { color:var(--text-muted); margin-bottom:20px; font-size:.9rem; }
.auth-foot { text-align:center; margin-top:18px; font-size:.88rem; color:var(--text-muted); }
.auth-foot a { color:var(--mutesh-blue); font-weight:600; }

/* product public grid */
.product-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:20px; }
.product-card-wrap { display:flex; flex-direction:column; border-radius:10px; overflow:hidden; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.product-card-wrap .product-card { flex:1; }
.product-card { background:#fff; border:1px solid var(--border-color); border-radius:10px; overflow:hidden; transition:transform .2s, box-shadow .2s; display:flex; flex-direction:column; }
.product-card:hover { transform:translateY(-4px); box-shadow:0 10px 20px rgba(0,0,0,.1); }
.product-card .pc-img { height:190px; background:#FAFAFA; display:flex; align-items:center; justify-content:center; }
.product-card .pc-img img { max-height:100%; max-width:100%; object-fit:contain; }
.product-card .pc-body { padding:16px; display:flex; flex-direction:column; flex-grow:1; }
.product-card .pc-cat { font-size:.72rem; text-transform:uppercase; color:var(--text-muted); font-weight:600; }
.product-card .pc-title { font-size:1rem; font-weight:700; margin:4px 0; }
.product-card .pc-brand { font-size:.8rem; color:var(--text-muted); }
.product-card .pc-price { font-size:1.2rem; font-weight:800; color:var(--mutesh-blue); margin-top:auto; padding-top:8px; }
.stock-ok { color:var(--success); font-weight:600; }
.stock-low { color:var(--warn); font-weight:600; }
.stock-out { color:var(--danger); font-weight:600; }

/* pagination */
.pagination { display:flex; gap:6px; list-style:none; margin-top:20px; }
.pagination a, .pagination span { padding:8px 12px; border:1px solid var(--border-color); border-radius:6px; font-size:.85rem; }
.pagination .active a, .pagination a:hover { background:var(--mutesh-blue); color:#fff; }
.pagination .disabled span { color:var(--text-muted); background:var(--mutesh-bg-light); }

/* utility */
.flex-between { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; flex-wrap:wrap; gap:10px; }
.muted { color:var(--text-muted); }
.small { font-size:.8rem; }
.right { text-align:right; }
.mt20 { margin-top:20px; }
.empty-state { text-align:center; padding:50px 20px; color:var(--text-muted); }
.empty-state i { font-size:3rem; color:var(--border-color); margin-bottom:14px; }
.text-danger { color:var(--danger); }
.nowrap { white-space:nowrap; }


/* ====== Enhanced header: search, cart, mobile nav ====== */
.header-search { flex:1 1 320px; max-width:560px; }
.hs-wrap { display:flex; align-items:stretch; border:2px solid var(--mutesh-blue); border-radius:30px; overflow:hidden; background:#fff; transition:box-shadow .2s; }
.hs-wrap:focus-within { box-shadow:0 0 0 4px rgba(10,50,152,.12); }
.hs-select { border:none; padding:10px 12px; font-size:.82rem; font-weight:600; color:var(--mutesh-blue); background:var(--mutesh-bg-light); border-right:1px solid var(--border-color); max-width:150px; cursor:pointer; outline:none; }
.hs-input { flex:1; border:none; padding:10px 14px; font-size:.9rem; outline:none; background:transparent; min-width:0; }
.hs-btn { display:flex; align-items:center; gap:6px; background:var(--mutesh-blue); color:#fff; border:none; padding:0 20px; font-weight:700; font-size:.85rem; cursor:pointer; transition:background .2s; }
.hs-btn:hover { background:var(--mutesh-blue-dark); }

/* cart trigger */
.cart-trigger { position:relative; background:transparent; border:none; cursor:pointer; font-size:1.4rem; color:var(--mutesh-blue); padding:6px; display:flex; align-items:center; }
.cart-trigger:hover { color:var(--mutesh-blue-dark); }
.cart-badge { position:absolute; top:-4px; right:-6px; background:var(--mutesh-yellow); color:var(--mutesh-blue-dark); font-size:.65rem; font-weight:800; min-width:18px; height:18px; border-radius:9px; display:flex; align-items:center; justify-content:center; padding:0 4px; border:2px solid #fff; }
.cart-badge-hidden { display:none; }

/* hamburger */
.hamburger { display:none; flex-direction:column; justify-content:center; gap:5px; width:40px; height:40px; background:transparent; border:none; cursor:pointer; padding:8px; }
.hamburger span { display:block; height:3px; width:100%; background:var(--mutesh-blue); border-radius:2px; transition:all .3s; }
.hamburger.active span:nth-child(1) { transform:translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity:0; }
.hamburger.active span:nth-child(3) { transform:translateY(-8px) rotate(-45deg); }

/* cart drawer */
.cart-drawer { position:fixed; top:0; right:-420px; width:400px; max-width:100vw; height:100vh; background:#fff; box-shadow:-8px 0 30px rgba(0,0,0,.15); z-index:2000; display:flex; flex-direction:column; transition:right .35s cubic-bezier(.4,0,.2,1); }
.cart-drawer.open { right:0; }
.cd-overlay { position:fixed; inset:0; background:rgba(6,31,99,.45); z-index:1999; opacity:0; visibility:hidden; transition:opacity .3s; }
.cd-overlay.open { opacity:1; visibility:visible; }
.cd-header { display:flex; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid var(--border-color); background:var(--mutesh-blue); color:#fff; }
.cd-header h3 { font-size:1.05rem; font-weight:700; display:flex; align-items:center; gap:10px; }
.cd-close { background:transparent; border:none; color:#fff; font-size:1.3rem; cursor:pointer; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; transition:background .2s; }
.cd-close:hover { background:rgba(255,255,255,.18); }
.cd-body { flex:1; overflow-y:auto; padding:12px 16px; }
.cd-item { display:flex; gap:12px; padding:14px 0; border-bottom:1px solid var(--border-color); }
.cd-item-img { width:64px; height:64px; flex-shrink:0; border-radius:8px; overflow:hidden; background:var(--mutesh-bg-light); display:flex; align-items:center; justify-content:center; border:1px solid var(--border-color); }
.cd-item-img img { width:100%; height:100%; object-fit:cover; }
.cd-item-img i { color:var(--border-color); font-size:1.4rem; }
.cd-item-info { flex:1; min-width:0; }
.cd-item-name { font-weight:600; font-size:.88rem; color:var(--text-dark); line-height:1.3; }
.cd-item-var { font-size:.75rem; color:var(--text-muted); margin:2px 0; }
.cd-item-price { font-weight:700; color:var(--mutesh-blue); font-size:.88rem; margin-bottom:6px; }
.cd-item-qty { display:flex; align-items:center; gap:10px; }
.cd-qty-controls { display:flex; align-items:center; gap:6px; background:var(--mutesh-bg-light); border-radius:20px; padding:2px; }
.cd-qty-btn { width:26px; height:26px; border-radius:50%; border:none; background:#fff; color:var(--mutesh-blue); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:.7rem; box-shadow:0 1px 2px rgba(0,0,0,.1); transition:background .15s; }
.cd-qty-btn:hover { background:var(--mutesh-yellow); }
.cd-qty-val { min-width:22px; text-align:center; font-weight:600; font-size:.82rem; }
.cd-remove-form { display:inline; }
.cd-remove { background:transparent; border:none; color:var(--danger); cursor:pointer; font-size:.85rem; padding:4px; }
.cd-remove:hover { opacity:.7; }
.cd-empty { text-align:center; padding:60px 20px; color:var(--text-muted); }
.cd-empty i { font-size:3rem; color:var(--border-color); margin-bottom:14px; display:block; }
.cd-empty p { margin-bottom:18px; }
.cd-footer { padding:18px 20px; border-top:1px solid var(--border-color); background:var(--mutesh-bg-light); }
.cd-total { display:flex; justify-content:space-between; align-items:center; font-size:1rem; margin-bottom:14px; }
.cd-total strong { font-size:1.3rem; color:var(--mutesh-blue); }
.cd-checkout { width:100%; padding:12px; font-size:.95rem; margin-bottom:10px; }
.cd-clear { width:100%; background:transparent; border:none; color:var(--text-muted); font-size:.8rem; cursor:pointer; padding:6px; }
.cd-clear:hover { color:var(--danger); }

/* responsive */
@media (max-width: 992px) {
    .header-search { order:3; flex:1 1 100%; max-width:none; }
    .hs-select { max-width:120px; }
    .stat-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); }
}
@media (max-width: 768px) {
    .tb-phone { display:none; }
    .hamburger { display:flex; }
    .header-account .account-name { display:none; }
    .header-account .hd-label { display:none; }
    .main-nav { max-height:0; overflow:hidden; transition:max-height .4s ease; border-top:none; }
    .main-nav.open { max-height:600px; border-top:1px solid var(--border-color); }
    .main-nav .nav-links { flex-direction:column; align-items:stretch; }
    .main-nav .nav-links a { padding:14px 16px; border-bottom:1px solid var(--border-color); }
    .main-nav .nav-links a:hover::after { display:none; }
    .cart-drawer { width:100vw; right:-100vw; }
    .hs-btn span { display:none; }
    .hs-btn { padding:0 16px; }
    .hs-select { max-width:110px; font-size:.72rem; }
    .header-row { padding:10px 16px; gap:10px; }
    .logo-icon { width:36px; height:36px; font-size:1.1rem; }
    .logo-text h1 { font-size:1rem; }
    .logo-text span { font-size:.6rem; }
    .page-content { padding:18px 14px; }
    .page-title { font-size:1.3rem; }
    .product-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
    .product-card .pc-img { height:140px; }
    .product-card .pc-body { padding:10px; }
    .product-card .pc-title { font-size:.82rem; }
    .product-card .pc-price { font-size:1rem; }
    .pc-add, .btn-add-cart { font-size:.72rem; padding:10px 6px; }
    .pc-add i, .btn-add-cart i { font-size:.72rem; }
    .form-grid { grid-template-columns:1fr; }
    .stat-grid { grid-template-columns:repeat(2,1fr); gap:12px; }
    .stat-card { padding:14px; }
    .stat-card .stat-num { font-size:1.4rem; }
    .product-detail-card { display:grid; grid-template-columns:1fr; gap:20px; padding:14px; }
    .pdc-main-img { width:100%; border-radius:10px; }
    .img-grid { grid-template-columns:repeat(4,1fr); gap:8px; }
    .img-card img { height:70px; }
    .top-bar { font-size:.72rem; padding:6px 0; }
    .top-bar-info span { margin-right:10px; }
    .top-bar-info span:first-child { display:none; }
    .table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .table { min-width:480px; }
    .card { padding:14px; }
    .flex-between { flex-direction:column; align-items:stretch; }
    .pagination { flex-wrap:wrap; justify-content:center; }
    .pagination a, .pagination span { padding:6px 10px; font-size:.8rem; }
    .auth-wrap { margin:16px auto; }
    .auth-card { padding:18px; }
    .cd-item-img { width:54px; height:54px; }
    .cd-item-name { font-size:.82rem; }
    .cd-qty-btn { width:24px; height:24px; font-size:.62rem; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns:repeat(2,1fr); gap:10px; }
    .product-card .pc-img { height:130px; }
    .product-card .pc-body { padding:8px; }
    .product-card .pc-title { font-size:.78rem; line-height:1.2; }
    .product-card .pc-price { font-size:.95rem; }
    .product-card .pc-cat { font-size:.62rem; }
    .pc-add, .btn-add-cart { font-size:.68rem; padding:8px 4px; }
    .pc-add i, .btn-add-cart i { font-size:.68rem; }
    .stat-grid { grid-template-columns:1fr; }
    .header-search { display:none; }
    .header-search.mobile-open { display:block; flex:1 1 100%; order:5; max-width:none; }
    .hs-wrap { border-radius:8px; }
    .img-grid { grid-template-columns:repeat(3,1fr); }
    .logo-text { display:none; }
    .hero-content h2 { font-size:1.8rem; }
    .hero-content { padding:24px; }
    .brand-badges { gap:8px; }
    .badge-item { min-width:90px; font-size:.72rem; padding:8px 6px; }
    .promo-banner { padding:20px; flex-direction:column; text-align:center; gap:12px; }
    .promo-text h3 { font-size:1.3rem; }
}

/* product detail card layout */
.product-detail-card { display:grid; grid-template-columns:1fr 1fr; gap:30px; align-items:start; padding:20px; }
.pdc-main-img { width:100%; border-radius:10px; }
.pdc-info > p { margin:6px 0; }

/* table horizontal scroll wrapper */
.table-wrap { width:100%; }

/* mobile search toggle button */
.mobile-search-btn { display:none; background:transparent; border:none; font-size:1.3rem; color:var(--mutesh-blue); cursor:pointer; padding:6px; }
@media (max-width: 480px) {
    .mobile-search-btn { display:flex; align-items:center; }
}

/* Make all tables scrollable on mobile (global) */
@media (max-width: 768px) {
    .table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; white-space:nowrap; max-width:100%; }
    .card > form[style*="display:flex"] { flex-direction:column; align-items:stretch; }
    .card > form[style*="display:flex"] > * { width:100%; }
    .flex-between { flex-direction:column; align-items:stretch; }
}

/* Product description (HTML from source) */
.product-description { line-height:1.6; color:var(--text-dark); }
.product-description h3 { color:var(--mutesh-blue); margin:14px 0 8px; }
.product-description h4 { margin:12px 0 6px; }
.product-description p { margin:8px 0; }
.product-description ul, .product-description ol { margin:8px 0 8px 22px; }
.product-description li { margin:4px 0; }
.product-description strong { font-weight:700; }
.product-description img { max-width:100%; height:auto; border-radius:6px; margin:8px 0; }
.product-description table { border-collapse:collapse; width:100%; margin:10px 0; }
.product-description td, .product-description th { border:1px solid var(--border-color); padding:6px 10px; text-align:left; }
