/* admin/css/admin.css */

:root {
    --primary: #064e3b;
    --primary-dark: #022c22;
    --primary-light: #10b981;
    --primary-bg: #ecfdf5;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --bg-gray: #f8fafc;
    --bg-card: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #f1f5f9;
    --border-dark: #e2e8f0;

    --font-primary: 'Outfit', sans-serif;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.06), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 16px 32px -8px rgba(15, 23, 42, 0.08), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
    --shadow-premium: 0 24px 48px -12px rgba(6, 78, 59, 0.08), 0 12px 24px -6px rgba(6, 78, 59, 0.04);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

    --grad-primary: linear-gradient(135deg, var(--primary) 0%, #0d9488 100%);
    --grad-primary-light: linear-gradient(135deg, var(--primary-light) 0%, #059669 100%);
    --grad-accent: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --grad-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
}

.flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

.hidden {
    display: none !important;
}

/* Custom Admin Page specific utilities */
.checkout-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.btn-accent {
    background: linear-gradient(135deg, var(--primary-light) 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* --- ADMIN LOGIN PANEL STYLE --- */
body.admin-login-body {
    background: linear-gradient(135deg, #022c22 0%, #064e3b 50%, #0f172a 100%);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

body.admin-login-body::before,
body.admin-login-body::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 1;
    pointer-events: none;
    animation: float-blobs 15s infinite alternate ease-in-out;
}

body.admin-login-body::before {
    top: -80px;
    left: -80px;
}

body.admin-login-body::after {
    bottom: -80px;
    right: -80px;
    animation-delay: -7.5s;
}

@keyframes float-blobs {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, 40px) scale(1.15);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 44px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
    z-index: 10;
    text-align: center;
    animation: card-appear 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.93);
    }

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

.login-logo {
    width: 120px;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.login-logo:hover {
    transform: scale(1.06) rotate(1deg);
}

.login-card h2 {
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.login-card p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin: 0 0 32px 0;
    font-weight: 500;
}

.form-group-login {
    position: relative;
    margin-bottom: 24px;
    text-align: left;
}

.form-group-login label {
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper-login {
    position: relative;
}

.input-wrapper-login i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 16px;
    transition: color 0.3s ease;
}

.form-control-login {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 15px 16px 15px 46px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
}

.form-control-login:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.form-control-login:focus+i {
    color: #10b981;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 15px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35);
    margin-top: 10px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fca5a5;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    animation: shake-error 0.5s ease;
}

.login-success-alert {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #a7f3d0;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    animation: fadeInUp 0.4s ease;
}

.login-warning-alert {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fde047;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    animation: fadeInUp 0.4s ease;
}

@keyframes shake-error {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.footer-info {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-weight: 500;
    margin-top: 32px;
}


/* --- ADMIN DASHBOARD PANEL LAYOUT --- */
.admin-container {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

@media(min-width: 992px) {
    .admin-container {
        grid-template-columns: 260px 1fr;
    }
}

.admin-sidebar {
    background: linear-gradient(180deg, #022c22 0%, #064e3b 100%);
    color: white;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid rgba(16, 185, 129, 0.1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand-text h2 {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-brand-text p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-badge {
    font-size: 9px;
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 5px;
    font-weight: 850;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
    line-height: 1;
}

.admin-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-menu-item {
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.75);
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: -0.1px;
}

.menu-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.admin-menu-item.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    font-weight: 700;
}

.admin-main {
    background-color: #f8fafc;
    padding: 32px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 16px;
}

.admin-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.8px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(16, 185, 129, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(16, 185, 129, 0.15);
}

.stat-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.5px;
    margin-top: 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background-color: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.table-wrapper {
    background-color: var(--bg-card);
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.05);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-bottom: 28px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.admin-table th {
    background-color: #f8fafc;
    padding: 16px 20px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-dark);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.8px;
}

.admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    font-weight: 500;
    vertical-align: middle;
}

.admin-table tr:hover td {
    background-color: rgba(248, 250, 252, 0.5);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid transparent;
}

.status-badge.pending {
    background-color: #fffbeb;
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.15);
}

.status-badge.processing {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.12);
}

.status-badge.shipped {
    background-color: #fdf4ff;
    color: #a21caf;
    border-color: rgba(162, 28, 175, 0.12);
}

.status-badge.delivered {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.15);
}

.action-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit {
    background-color: #eff6ff;
    color: #2563eb;
    border-color: rgba(37, 99, 235, 0.1);
    margin-right: 4px;
    margin-bottom: 6px;
}

.btn-delete {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.1);
}

.btn-edit:hover {
    background-color: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-delete:hover {
    background-color: #dc2626;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

/* --- ADMIN FORM MODALS --- */
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.admin-modal {
    background-color: var(--bg-card);
    width: 100%;
    max-width: 520px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg), 0 20px 48px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
    border: 1px solid rgba(15, 23, 42, 0.05);
    animation: modal-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-modal form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #fafdfb, #ffffff);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header .close-cart {
    border: none;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-header .close-cart:hover {
    background: #e2e8f0;
    color: var(--text-dark);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.15) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.15);
    border-radius: 3px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-dark);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: #f8fafc;
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-dark);
}

/* --- Premium styling for table elements & badges --- */
.category-pill {
    background-color: #f1f5f9;
    color: #334155;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

.category-count-badge {
    font-weight: 700;
    color: var(--primary-light);
    background-color: var(--primary-bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(16, 185, 129, 0.12);
}

.stock-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    width: max-content;
}

.stock-badge.in-stock {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.stock-badge.low-stock {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.stock-badge.out-of-stock {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.15);
}

.stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.stock-dot.green {
    background-color: #16a34a;
}

.stock-dot.orange {
    background-color: #d97706;
}

.stock-dot.red {
    background-color: #dc2626;
}

/* Admin Weight Tiers in Table */
.admin-tier-price-row {
    display: flex;
    justify-content: space-between;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-dark);
    align-items: center;
    gap: 12px;
}

.admin-tier-price-row.has-override {
    background: #ecfdf5;
    border-color: #10b981;
}

.tier-label {
    font-weight: 700;
    color: #475569;
}

.admin-tier-price-row.has-override .tier-label {
    color: #065f46;
}

.tier-price-values {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tier-price-current {
    font-weight: 800;
    color: var(--text-dark);
}

.tier-price-old {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Auto calc indicators styling in modals */
.auto-calc-indicator {
    background-color: #eff6ff;
    color: #1d4ed8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid rgba(29, 78, 216, 0.1);
}

/* Modal Form Styles */
.override-price-input::placeholder,
.override-original-price-input::placeholder {
    color: #cbd5e1;
    font-style: italic;
}

/* --- MOBILE RESPONSIVE NAV HEADER & DRAWER SYSTEM --- */

.admin-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(135deg, #022c22 0%, #064e3b 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.admin-mobile-header .btn-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: var(--transition);
}

.admin-mobile-header .btn-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-mobile-header .mobile-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #ffffff;
    font-size: 16px;
}

.admin-mobile-header .mobile-logo {
    height: 32px;
    width: auto;
    border-radius: 6px;
}

.admin-mobile-header .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-mobile-header .mobile-header-btn {
    color: #ffffff;
    font-size: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: var(--transition);
}

.admin-mobile-header .mobile-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.admin-mobile-header .mobile-header-btn.logout {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-mobile-header .mobile-header-btn.logout:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Sidebar overlay backdrop for drawer */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1000;
    transition: var(--transition);
}

/* Close button inside sidebar on mobile */
.sidebar-header-mobile {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.sidebar-header-mobile .drawer-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.sidebar-header-mobile .btn-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.sidebar-header-mobile .btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* MEDIA QUERIES FOR MOBILE DRAWER & LAYOUTS */
@media (max-width: 991px) {
    .admin-mobile-header {
        display: flex;
    }

    .sidebar-header-mobile {
        display: flex;
    }

    .admin-container {
        grid-template-columns: 1fr;
        padding-top: 64px;
        /* Space for the sticky mobile header */
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        /* Hide off-screen */
        bottom: 0;
        width: 280px;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.25);
        overflow-y: auto;
        padding: 24px 20px;
    }

    .admin-sidebar.open {
        left: 0;
        /* Slide in */
    }

    .admin-main {
        padding: 24px 16px;
    }
}

@media (max-width: 767px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 20px;
    }

    .admin-header h2 {
        font-size: 22px;
    }

    .admin-header button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Collapse Admin Table into Cards */
    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table th,
    .admin-table td,
    .admin-table tr {
        display: block;
    }

    /* Hide headers visually but keep accessibility */
    .admin-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .admin-table tr {
        border: 1px solid var(--border-dark);
        margin-bottom: 20px;
        background: #ffffff;
        border-radius: 18px;
        padding: 12px;
        box-shadow: var(--shadow-sm);
    }

    .admin-table td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-left: 45% !important;
        text-align: right;
        min-height: 52px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        font-size: 13px;
    }

    .admin-table td:last-child {
        border-bottom: 0;
        justify-content: flex-end;
        gap: 8px;
    }

    .admin-table td:before {
        position: absolute;
        top: 50%;
        left: 12px;
        transform: translateY(-50%);
        width: 40%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 800;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        content: attr(data-label);
    }

    .admin-tier-price-container {
        width: 100%;
        max-width: 100% !important;
    }

    .admin-modal {
        margin: 16px 12px;
        max-height: calc(100vh - 32px);
    }

    .modal-body {
        max-height: none;
        padding: 16px;
    }

    /* Grid system layout collapse on mobile */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
}

/* Screen widths < 480px: stack key-values vertically for ultimate readability */
@media (max-width: 480px) {
    .admin-table tr {
        padding: 8px;
    }

    .admin-table td {
        padding-left: 12px !important;
        text-align: left;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        min-height: auto;
        padding-top: 28px !important;
        /* space for absolute header */
        padding-bottom: 12px !important;
    }

    .admin-table td:before {
        top: 8px;
        left: 12px;
        transform: none;
        width: 100%;
        padding-right: 0;
    }

    .admin-table td img {
        width: 44px !important;
        height: 44px !important;
        margin-left: 0;
    }

    .admin-table td:last-child {
        flex-direction: row;
        width: 100%;
    }

    .admin-table td .action-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 8px;
    }
}

/* Modal Tab Buttons styling */
.modal-tab-btn {
    border-bottom: 2px solid transparent !important;
    color: var(--text-muted) !important;
    transition: var(--transition);
}

.modal-tab-btn:hover {
    color: var(--text-dark) !important;
    background-color: rgba(15, 23, 42, 0.02) !important;
}

.modal-tab-btn.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary-light) !important;
    background-color: rgba(16, 185, 129, 0.04) !important;
}

/* Upgraded Premium Product Modal Styles */
.product-modal-upgraded {
    max-width: 680px !important;
    border: 1px solid rgba(16, 185, 129, 0.1);
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(16, 185, 129, 0.05);
    transition: var(--transition);
}

.product-modal-upgraded .modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 24px;
    background: linear-gradient(to right, #fafdfb, #ffffff);
}

.product-modal-upgraded .modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-modal-upgraded .close-modal-btn {
    border: none;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.product-modal-upgraded .close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-dark);
    transform: rotate(90deg);
}

/* Upgraded Tabs */
.product-modal-upgraded .modal-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 12px;
    gap: 6px;
}

.product-modal-upgraded .modal-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border: none;
    background: none;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted) !important;
    cursor: pointer;
    border-bottom: 3px solid transparent !important;
    transition: var(--transition);
    border-radius: 0 !important;
}

.product-modal-upgraded .modal-tab-btn i {
    font-size: 14px;
    opacity: 0.8;
}

.product-modal-upgraded .modal-tab-btn:hover {
    color: var(--text-dark) !important;
    background-color: rgba(15, 23, 42, 0.02) !important;
}

.product-modal-upgraded .modal-tab-btn.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary-light) !important;
    background-color: rgba(16, 185, 129, 0.04) !important;
}

/* Responsive Modal Adjustments */
@media (max-width: 600px) {
    .product-modal-upgraded .modal-tabs {
        flex-direction: column;
        padding: 6px;
        gap: 2px;
    }

    .product-modal-upgraded .modal-tab-btn {
        padding: 10px;
        justify-content: flex-start;
        border-bottom: none !important;
        border-left: 3px solid transparent !important;
        border-radius: 6px !important;
    }

    .product-modal-upgraded .modal-tab-btn.active {
        border-left-color: var(--primary-light) !important;
        background-color: rgba(16, 185, 129, 0.05) !important;
    }
}

/* Beautiful Form Styling Inside Modal */
.product-modal-upgraded .form-group {
    margin-bottom: 18px;
}

.product-modal-upgraded label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.product-modal-upgraded .form-control {
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    padding: 10px 14px;
    font-size: 13.5px;
    transition: var(--transition);
    background-color: #ffffff;
}

.product-modal-upgraded .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    background-color: #ffffff;
}

/* Dynamic weight tier styling */
.product-modal-upgraded .weight-tier-row {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 14px;
    transition: var(--transition);
}

.product-modal-upgraded .weight-tier-row:hover {
    border-color: rgba(16, 185, 129, 0.25);
    background: #fafdfb;
}

/* Custom Checkbox elements */
.product-modal-upgraded input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--text-muted);
    background: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    outline: none;
}

.product-modal-upgraded input[type="checkbox"]:checked {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.product-modal-upgraded input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    color: #ffffff;
    display: block;
}

.product-modal-upgraded input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Image Slots styling */
.product-modal-upgraded .file-uploader-wrap {
    background: #f8fafc;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}

.product-modal-upgraded .file-uploader-wrap:hover {
    border-color: rgba(16, 185, 129, 0.25);
    background: #fafdfb;
}

.product-modal-upgraded .file-uploader-input {
    padding: 6px;
    font-size: 12px;
}

.product-modal-upgraded .image-preview-container {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    border: 2px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f8fafc;
    flex-shrink: 0;
    transition: var(--transition);
}

.product-modal-upgraded .image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Footer buttons styling */
.product-modal-upgraded .modal-footer {
    padding: 18px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 14px;
}

.product-modal-upgraded .btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    transition: var(--transition);
}

.product-modal-upgraded .btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-dark);
    transform: translateY(-1px);
}

.product-modal-upgraded .btn-accent {
    background: var(--grad-primary-light);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transition: var(--transition);
}

.product-modal-upgraded .btn-accent:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* --- PREMIUM REDESIGNED PRODUCT TABLE ELEMENTS --- */

.product-info-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-dark);
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-pill {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.tag-pill.bestseller {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.tag-pill.daily-deal {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid rgba(185, 28, 28, 0.15);
}

.table-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #d97706;
    /* Gold/Amber */
}

.table-rating i {
    font-size: 11px;
}

.table-rating .review-count {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
}

/* Horizontal pills wrapper for price tiers */
.table-tiers-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 320px;
}

.tier-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f8fafc;
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 11.5px;
    transition: var(--transition);
}

.tier-pill:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

/* Custom override indicators for manually modified price tiers */
.tier-pill.override {
    background-color: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.tier-pill.override:hover {
    background-color: #d1fae5;
    border-color: #059669;
}

.tier-name {
    font-weight: 700;
    color: var(--text-muted);
}

.tier-pill.override .tier-name {
    color: #047857;
}

.tier-price {
    font-weight: 800;
    color: var(--text-dark);
}

.tier-pill.override .tier-price {
    color: #064e3b;
}

.tier-orig {
    font-size: 10px;
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.75;
}

/* Compact layout for stock indicator */
.stock-container-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.stock-mode-subtext {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2.5px 7px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.stock-mode-subtext.weight {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.stock-mode-subtext.unit {
    background-color: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

/* --- TABLE TOOLBAR: SEARCH & FILTER BAR --- */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.table-toolbar:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(16, 185, 129, 0.2);
}

.table-toolbar .search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

.table-toolbar .search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: var(--transition);
}

.table-toolbar .search-box input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    font-size: 13.5px;
    font-weight: 500;
    outline: none;
    transition: var(--transition);
    background-color: var(--bg-gray);
}

.table-toolbar .search-box input:focus {
    border-color: var(--primary-light);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.table-toolbar .search-box input:focus+.search-icon {
    color: var(--primary-light);
}

.table-toolbar .filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar .filter-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.table-toolbar .filter-select-wrapper .filter-select-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    transition: var(--transition);
}

.table-toolbar .filter-select-wrapper select {
    padding: 9px 32px 9px 34px;
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: var(--transition);
    min-width: 150px;
}

/* Custom dropdown arrow using inline SVG or background */
.table-toolbar .filter-select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
    pointer-events: none;
    transition: var(--transition);
}

.table-toolbar .filter-select-wrapper select:focus {
    border-color: var(--primary-light);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.table-toolbar .filter-select-wrapper select:focus+.filter-select-icon,
.table-toolbar .filter-select-wrapper:focus-within::after {
    color: var(--primary-light);
}

.table-toolbar .filter-select-wrapper select option {
    font-weight: 500;
    background-color: #ffffff;
}

/* Responsive Media Queries for Toolbar */
@media (max-width: 991px) {
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .table-toolbar .search-box {
        width: 100%;
        min-width: unset;
    }

    .table-toolbar .filter-group {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
        width: 100%;
    }

    .table-toolbar .filter-select-wrapper select {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .table-toolbar .filter-group {
        grid-template-columns: 1fr;
    }
}

.table-toolbar .btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 9px 18px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.table-toolbar .btn-reset:hover {
    background-color: #e2e8f0;
    color: var(--text-dark);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.table-toolbar .btn-reset i {
    font-size: 12px;
}

/* Hide HTML5 Up/Down arrows (spinners) from number inputs inside the admin modals */
/* Hide HTML5 Up/Down arrows (spinners) from number inputs inside the admin modals */
.admin-modal input[type="number"]::-webkit-outer-spin-button,
.admin-modal input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-modal input[type="number"] {
    -moz-appearance: textfield;
}

/* Upgraded Premium Category Modal Styles */
.category-modal-upgraded {
    max-width: 440px !important;
    border: 1px solid rgba(16, 185, 129, 0.1);
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(16, 185, 129, 0.05);
    transition: var(--transition);
}

.category-modal-upgraded .modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 18px 24px;
    background: linear-gradient(to right, #fafdfb, #ffffff);
}

.category-modal-upgraded .modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-modal-upgraded .close-modal-btn {
    border: none;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.category-modal-upgraded .close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-dark);
    transform: rotate(90deg);
}

.category-modal-upgraded .form-group {
    margin-bottom: 18px;
}

.category-modal-upgraded label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    display: block;
}

.category-modal-upgraded .form-control {
    border-radius: 10px;
    border: 1px solid var(--border-dark);
    padding: 10px 14px;
    font-size: 13.5px;
    transition: var(--transition);
    background-color: #ffffff;
}

.category-modal-upgraded .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    background-color: #ffffff;
}

/* Custom file uploader area */
.category-modal-upgraded .uploader-click-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
}

.category-modal-upgraded .uploader-click-zone.drag-over {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
}

.category-modal-upgraded .uploader-click-zone:hover {
    border-color: var(--primary-light);
    background: rgba(16, 185, 129, 0.02);
}

.category-modal-upgraded .uploader-icon {
    font-size: 28px;
    color: var(--primary-light);
    margin-bottom: 10px;
    transition: var(--transition);
}

.category-modal-upgraded .uploader-click-zone:hover .uploader-icon {
    transform: translateY(-2px);
}

.category-modal-upgraded .uploader-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.category-modal-upgraded .uploader-text .highlight {
    color: var(--primary);
    text-decoration: underline;
}

.category-modal-upgraded .subtext {
    font-size: 11px;
    color: var(--text-muted);
}

.category-modal-upgraded .file-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.category-modal-upgraded .image-preview-box {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.category-modal-upgraded .image-preview-box:empty {
    display: none !important;
}

.category-modal-upgraded .image-preview-box img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-modal-upgraded .image-preview-box span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    word-break: break-all;
}

/* Footer buttons styling */
.category-modal-upgraded .modal-footer {
    padding: 18px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.category-modal-upgraded .btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
}

.category-modal-upgraded .btn-secondary:hover {
    background-color: #e2e8f0;
    color: var(--text-dark);
}

.category-modal-upgraded .btn-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 700;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.category-modal-upgraded .btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* --- UPGRADED ORDERS & FULFILLMENT UI/UX STYLES --- */

.orders-subtabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-dark);
    padding-bottom: 1px;
}

.orders-subtab-btn {
    padding: 12px 20px;
    font-weight: 750;
    font-size: 14px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
}

.orders-subtab-btn:hover {
    color: var(--text-dark);
}

.orders-subtab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}

.date-group-header {
    background-color: var(--primary-bg);
    color: var(--primary);
    padding: 12px 20px;
    font-weight: 800;
    font-size: 13.5px;
    border-radius: 12px;
    margin: 28px 0 14px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(16, 185, 129, 0.08);
}

.date-group-header i {
    margin-right: 6px;
}

.date-group-badge {
    background-color: var(--primary-light);
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}

/* Dynamic color-coded select dropdowns for order fulfillment statuses */
select.order-status-dropdown {
    font-weight: 750;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid transparent;
    font-size: 12px;
    outline: none;
}

select.order-status-dropdown:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

select.order-status-dropdown.Pending,
select.order-status-dropdown.pending {
    background-color: #fffbeb !important;
    color: #d97706 !important;
    border-color: rgba(245, 158, 11, 0.15);
}

select.order-status-dropdown.Processing,
select.order-status-dropdown.processing {
    background-color: #eff6ff !important;
    color: #2563eb !important;
    border-color: rgba(37, 99, 235, 0.12);
}

select.order-status-dropdown.Out-for-Delivery,
select.order-status-dropdown.out-for-delivery,
select.order-status-dropdown.Shipping,
select.order-status-dropdown.shipping {
    background-color: #f5f3ff !important;
    color: #7c3aed !important;
    border-color: rgba(124, 58, 237, 0.12);
}

select.order-status-dropdown.Delivered,
select.order-status-dropdown.delivered {
    background-color: #f0fdf4 !important;
    color: #16a34a !important;
    border-color: rgba(22, 163, 74, 0.15);
}

.payment-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.payment-badge.cod {
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.15);
}

.payment-badge.online {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.item-badge {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 750;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
}

.item-badge.more {
    background-color: #f8fafc;
    color: var(--text-muted);
}

/* Order detailed modal */
.order-details-modal {
    max-width: 680px !important;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media(max-width: 576px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }
}

.order-card-detail {
    background: #f8fafc;
    border: 1px solid var(--border-dark);
    padding: 16px;
    border-radius: 14px;
}

.order-card-detail h4 {
    color: var(--primary);
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-dark);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.order-detail-row:last-child {
    margin-bottom: 0;
}

.order-detail-label {
    color: var(--text-muted);
    font-weight: 600;
}

.order-detail-val {
    color: var(--text-dark);
    font-weight: 700;
    text-align: right;
}

/* Visual timeline progress tracker */
.status-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 25px 0;
    position: relative;
    padding: 0 10px;
}

.status-tracker::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 24px;
    right: 24px;
    height: 4px;
    background-color: var(--border-dark);
    z-index: 1;
}

.status-tracker-line {
    position: absolute;
    top: 22px;
    left: 24px;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-light), var(--primary));
    z-index: 2;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 3;
    flex: 1;
}

.tracker-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid var(--border-dark);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.tracker-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.tracker-step.completed .tracker-icon {
    background-color: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary);
}

.tracker-step.completed .tracker-label {
    color: var(--primary);
}

.tracker-step.active .tracker-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
    transform: scale(1.08);
}

.tracker-step.active .tracker-label {
    color: var(--text-dark);
    font-weight: 850;
}

/* --- UI BUG FIXES --- */

/* Generic close-modal-btn styling for all modal variants */
.close-modal-btn,
button.close-modal-btn,
#btn-close-order-details-modal,
#btn-close-product-modal,
#btn-close-category-modal {
    border: none !important;
    background: #f1f5f9 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    outline: none !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.close-modal-btn:hover,
button.close-modal-btn:hover,
#btn-close-order-details-modal:hover,
#btn-close-product-modal:hover,
#btn-close-category-modal:hover {
    background: #e2e8f0 !important;
    color: var(--text-dark) !important;
    transform: rotate(90deg) !important;
}

.close-modal-btn i,
button.close-modal-btn i {
    font-size: 14px !important;
    line-height: 1 !important;
    display: inline-block !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Specific overrides for filter select dropdowns in the toolbar to prevent overlap and double arrows */
.table-toolbar .filter-select-wrapper select,
.filter-select-wrapper select,
#orders-filter-status,
#orders-filter-payment {
    padding-left: 38px !important;
    padding-right: 32px !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important; /* hides background-based arrows */
}

/* Specific hide rules for Microsoft Edge / IE */
.table-toolbar .filter-select-wrapper select::-ms-expand,
.filter-select-wrapper select::-ms-expand {
    display: none !important;
}

/* --- REAL-TIME ORDERS NOTIFICATION SYSTEM --- */

.admin-menu-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-badge {
    background-color: var(--accent); /* glowing amber/yellow */
    color: var(--text-dark) !important;
    font-size: 10px !important;
    font-weight: 850 !important;
    padding: 3px 8px !important;
    border-radius: 20px !important;
    min-width: 20px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    animation: pulse-glowing 2s infinite ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Pulsing glow animation for the sidebar badge */
@keyframes pulse-glowing {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        transform: scale(1);
    }
}

/* Animation for table rows to highlight new order placements */
.new-order-row {
    animation: new-row-glow 4s ease-out;
}

@keyframes new-row-glow {
    0% {
        background-color: rgba(245, 158, 11, 0.15) !important;
    }
    100% {
        background-color: transparent !important;
    }
}

/* Mobile header order badge */
.mobile-badge-container {
    position: relative;
    display: inline-block;
}

.mobile-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent);
    color: var(--text-dark);
    font-size: 8px;
    font-weight: 850;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

/* Sidebar Footer & Buttons styling */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer-btn {
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-footer-btn.store {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-footer-btn.store:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-footer-btn.logout {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.sidebar-footer-btn.logout:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

/* --- PREMIUM PRELOADER SCREEN --- */
.dashboard-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #064e3b 0%, #022c22 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    opacity: 1;
    visibility: visible;
}

.dashboard-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 320px;
    padding: 20px;
}

.preloader-logo-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 4px 12px rgba(16, 185, 129, 0.35));
}

.preloader-logo-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin-ring 1.2s cubic-bezier(0.5, 0.1, 0.1, 1) infinite;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

@keyframes spin-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preloader-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 850;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.preloader-status {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 20px 0;
    height: 18px; /* prevents layout shifting when text changes */
    transition: all 0.3s ease;
}

.preloader-progress-bar {
    width: 180px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.preloader-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}