/* ==========================================================================
   Store Vegtables - Standalone Admin Portal Stylesheet (admin.css - Mobile First)
   ========================================================================== */

/* Root variables fallback */
/* ==========================================================================
   MOTION SPLASH SCREEN (MATCHING ULTRA LUXURY APP SPLASH MOTION)
   ========================================================================== */
.motion-splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at center, #151d24 0%, #0a0e12 100%);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    direction: rtl;
    font-family: inherit;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s;
    user-select: none;
    -webkit-user-select: none;
}

.motion-splash-screen.splash-hide {
    opacity: 0;
    transform: scale(1.04);
    visibility: hidden;
    pointer-events: none;
}

/* 3D Curved Background Layers (Swooshes) */
.splash-bg-layer {
    position: absolute;
    pointer-events: none;
    will-change: transform, opacity;
}

.splash-wave-1 {
    top: -20%;
    right: -20%;
    width: 85vw;
    height: 85vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.03) 60%, transparent 80%);
    border-radius: 43% 57% 70% 30% / 30% 45% 55% 70%;
    filter: blur(40px);
    animation: splashSwooshFloat 8s ease-in-out infinite alternate;
}

.splash-wave-2 {
    bottom: -25%;
    left: -20%;
    width: 90vw;
    height: 90vw;
    max-width: 650px;
    max-height: 650px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(16, 185, 129, 0.04) 50%, transparent 75%);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    filter: blur(50px);
    animation: splashSwooshFloat 10s ease-in-out infinite alternate-reverse;
}

.splash-wave-3 {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 45%, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
}

@keyframes splashSwooshFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(25px, 20px) rotate(15deg); }
}

/* Center Stage Container */
.splash-center-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 420px;
    width: 90%;
    z-index: 10;
}

/* Orbital Swirling Light Trails */
.splash-orbital-swirl {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 170px;
    height: 170px;
    transform: translate(-50%, -60%);
    pointer-events: none;
}

.orbital-trail {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    will-change: transform;
}

.trail-1 {
    border-top-color: #10B981;
    border-right-color: #34D399;
    filter: drop-shadow(0 0 10px #10B981);
    animation: splashOrbitRotate 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.trail-2 {
    border-bottom-color: #F59E0B;
    border-left-color: #FBBF24;
    filter: drop-shadow(0 0 8px #F59E0B);
    animation: splashOrbitRotateReverse 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform: scale(0.85);
}

.trail-3 {
    border-top-color: #059669;
    border-left-color: #6EE7B7;
    filter: drop-shadow(0 0 12px #34D399);
    animation: splashOrbitRotate 1.4s linear infinite;
    transform: scale(1.15);
}

@keyframes splashOrbitRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes splashOrbitRotateReverse {
    0% { transform: rotate(360deg) scale(0.85); }
    100% { transform: rotate(0deg) scale(0.85); }
}

/* Radial Particle Pulse Burst */
.splash-radial-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    transform: translate(-50%, -60%) scale(0.6);
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0) 70%);
    animation: splashBurstPulse 2.2s ease-out infinite;
    pointer-events: none;
}

@keyframes splashBurstPulse {
    0% { transform: translate(-50%, -60%) scale(0.4); opacity: 0.8; }
    50% { transform: translate(-50%, -60%) scale(1.5); opacity: 0.3; }
    100% { transform: translate(-50%, -60%) scale(2.2); opacity: 0; }
}

/* Brand Logo Box */
.splash-logo-box {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5),
                0 0 25px rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    animation: splashLogoReveal 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    will-change: transform, opacity;
}

.splash-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

@keyframes splashLogoReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Brand Identity Typography */
.splash-brand-details {
    margin-top: 1.4rem;
    animation: splashTextReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

.splash-brand-name {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #FFFFFF 30%, #E2E8F0 60%, #6EE7B7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.splash-brand-subtitle {
    margin: 4px 0 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #34D399;
}

.splash-brand-tagline {
    margin-top: 0.75rem;
    display: inline-block;
    padding: 0.3rem 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94A3B8;
}

/* Sleek Bottom Loading Line */
.splash-loader-track {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 1.75rem;
    position: relative;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #10B981, #F59E0B);
    border-radius: 999px;
    animation: splashLoadFill 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashLoadFill {
    0% { width: 0%; }
    40% { width: 45%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

@keyframes splashTextReveal {
    0% {
        opacity: 0;
        transform: translateY(14px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ECFDF5;
    --dark-green: #064E3B;
    --accent: #F59E0B;
    --border: #E2E8F0;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Auth Screen */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #064E3B 0%, #0F5132 50%, #059669 100%);
    padding: 1.25rem;
}

.auth-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.auth-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin: 0 auto 1.25rem;
}

.auth-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 0.4rem;
}

.auth-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.pin-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 1rem;
    background: #F1F5F9;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.back-link {
    display: inline-block;
    margin-top: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
}

.back-link:hover {
    text-decoration: underline;
}

/* Dashboard Wrap */
.dashboard-wrap {
    min-height: 100vh;
    background: #F8FAFC;
    padding-bottom: 5rem;
}

.hidden {
    display: none !important;
}

/* Standard Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
    box-sizing: border-box;
    touch-action: manipulation;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.28);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857, #065F46);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.38);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: #FFFFFF;
    color: #334155;
    border: 1.5px solid #CBD5E1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.btn-secondary:hover {
    background: #F8FAFC;
    border-color: #94A3B8;
    color: #0F172A;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
}

.btn-block {
    width: 100%;
}

/* Admin Navbar (Modern Top Bar) */
.admin-navbar {
    background: linear-gradient(135deg, #064E3B 0%, #065F46 60%, #047857 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 4px 20px rgba(6, 78, 59, 0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

.admin-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
    text-align: right;
}

.admin-brand-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.admin-brand-store {
    font-size: 0.8rem;
    font-weight: 700;
    color: #A7F3D0;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-nav-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 0.9rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-action-preview {
    background: #FFFFFF;
    color: #064E3B;
    font-weight: 900;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-action-preview:hover {
    background: #F0FDF4;
    transform: translateY(-1px);
}

.btn-action-logout {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-action-logout:hover {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    transform: translateY(-1px);
}

/* Smart Admin App Installation Banner */
.admin-pwa-banner {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-bottom: 2px solid #A7F3D0;
    padding: 0.75rem 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

.pwa-banner-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1rem;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.pwa-banner-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #059669;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.pwa-banner-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    min-width: 0;
}

.pwa-banner-info strong {
    font-size: 0.95rem;
    color: #065F46;
    font-weight: 900;
}

.pwa-banner-info p {
    margin: 2px 0 0 0;
    font-size: 0.8rem;
    color: #047857;
    font-weight: 700;
}

.btn-pwa-install-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #059669, #047857);
    color: #FFFFFF;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-pwa-install-action:hover {
    background: linear-gradient(135deg, #047857, #065F46);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(5, 150, 105, 0.4);
}

.btn-pwa-install-action:active {
    transform: scale(0.97);
}

/* Progress Bar State */
.pwa-progress-state-wrap,
.pwa-progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.2rem 0;
}

.pwa-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.86rem;
    font-weight: 800;
    color: #065F46;
}

.pwa-progress-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pwa-progress-percent {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 900;
    color: #047857;
}

.pwa-progress-track {
    width: 100%;
    height: 10px;
    background: rgba(5, 150, 105, 0.15);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.pwa-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #10B981, #059669, #34D399);
    background-size: 200% 100%;
    animation: pwaProgressGlow 1.5s linear infinite;
    border-radius: 999px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pwaProgressGlow {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Success & Open App State */
.pwa-success-state-wrap,
.pwa-success-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.pwa-success-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.pwa-success-icon {
    font-size: 1.8rem;
    color: #059669;
    animation: pwaCheckPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pwaCheckPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.pwa-success-info strong {
    font-size: 0.95rem;
    color: #065F46;
    font-weight: 900;
}

.pwa-success-info p {
    margin: 2px 0 0 0;
    font-size: 0.78rem;
    color: #047857;
    font-weight: 700;
}

.btn-pwa-open-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF !important;
    font-family: inherit;
    font-weight: 900;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pwaOpenPulse 2s infinite;
    transition: all 0.25s ease;
    white-space: nowrap;
    border: none;
    flex-shrink: 0;
}

.btn-pwa-open-app:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.5);
    background: linear-gradient(135deg, #047857 0%, #065F46 100%);
}

.pwa-success-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-pwa-cancel-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-family: inherit;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-pwa-cancel-open:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1E293B;
    transform: translateY(-1px);
}

@keyframes pwaOpenPulse {
    0% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (max-width: 640px) {
    .pwa-success-state-wrap,
    .pwa-success-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .pwa-success-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }

    .btn-pwa-open-app {
        flex: 2;
        padding: 0.65rem;
        font-size: 0.9rem;
    }

    .btn-pwa-cancel-open {
        flex: 1;
        padding: 0.65rem;
        font-size: 0.85rem;
    }
}

/* Standalone / PWA Mode: Completely and permanently hide all install prompts */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    #adminPwaInstallBar,
    #adminPwaInstallBtn {
        display: none !important;
    }
}

/* Main Dashboard */
.admin-main {
    margin-top: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.admin-stat-card i {
    font-size: 1.8rem;
    color: var(--primary);
}

.admin-stat-card.success i {
    color: #10B981;
}

.admin-stat-card.danger i {
    color: #EF4444;
}

.admin-stat-card.whatsapp i {
    color: #25D366;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
    display: block;
}

.stat-num-sm {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    word-break: break-all;
}

.stat-lbl {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Settings Bar */
.admin-settings-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.settings-group {
    flex-grow: 1;
    max-width: 500px;
}

.settings-group label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 0.4rem;
    display: block;
}

.phone-input-row {
    display: flex;
    gap: 0.5rem;
}

.phone-input-row input {
    flex-grow: 1;
    padding: 0.55rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.phone-input-row input:focus {
    border-color: var(--primary);
}

/* Table Card */
.table-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.table-card-header {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.table-card-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dark-green);
}

.table-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.admin-search-box {
    position: relative;
    flex-grow: 1;
    min-width: 200px;
}

.admin-search-box i {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.admin-search-box input {
    width: 100%;
    padding: 0.55rem 2.5rem 0.55rem 0.85rem;
    font-family: inherit;
    font-size: 0.88rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
}

.admin-cat-filters {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
}

.admin-tab {
    background: #F1F5F9;
    border: 1px solid var(--border);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.admin-tab.active {
    background: var(--dark-green);
    color: white;
    border-color: var(--dark-green);
}

/* Table Design */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    min-width: 600px;
}

.admin-table th {
    background: #F8FAFC;
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.admin-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-prod-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-prod-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.table-prod-title {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-main);
}

.cat-badge-table {
    background: #ECFDF5;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.price-input-table {
    width: 95px;
    padding: 0.4rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #CBD5E1;
    transition: 0.3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.table-actions-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-edit-table {
    background: var(--primary-light);
    color: var(--dark-green);
    border: 1px solid #A7F3D0;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.delete-btn-table {
    background: #FEF2F2;
    color: #EF4444;
    border: 1px solid #FCA5A5;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

/* Category Item Row */
.category-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.88rem;
}

.table-card-footer {
    padding: 1.1rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid var(--border);
    text-align: left;
}

.btn-lg {
    padding: 0.75rem 1.4rem;
    font-size: 1rem;
}

/* Mobile & Phone Ultra Responsive Polish */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
    }

    .admin-stat-card {
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .admin-stat-card i {
        font-size: 1.4rem;
    }

    .stat-num {
        font-size: 1.2rem;
    }

    .admin-settings-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 0.85rem 1rem;
    }

    .table-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .table-card-header h3 {
        font-size: 1rem;
    }

    .table-card-header button {
        width: 100%;
    }

    .admin-search-box {
        width: 100%;
    }

    .table-card-footer button {
        width: 100%;
    }

    .table-actions-cell {
        flex-direction: row;
        gap: 0.35rem;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 88vh;
    }

    /* Full screen mobile modal for Orders & Edit Order */
    #ordersModal .modal-content,
    #editOrderModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        display: flex;
        flex-direction: column;
    }

    #ordersModal .modal-body,
    #editOrderModal .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 0.85rem !important;
    }
}

/* Product Image Management Section */
.product-image-management-section {
    background: #F8FAFC;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.image-section-label {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-upload-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-input-hidden {
    display: none !important;
}

.file-picker-btn {
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.5rem 0.85rem;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-upload {
    background: var(--dark-green);
    color: white;
    border: none;
    padding: 0.5rem 0.95rem;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.image-hint-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.image-preview-box {
    position: relative;
    max-width: 100%;
    max-height: 220px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.product-preview-img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.remove-img-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-full);
}

.upload-spinner {
    font-size: 0.82rem;
    color: var(--dark-green);
    font-weight: 700;
}

.image-status-msg {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
}

.image-status-msg.success {
    background: #D1FAE5;
    color: #065F46;
}

.image-status-msg.error {
    background: #FEE2E2;
    color: #991B1B;
}

@media (max-width: 768px) {
    .image-upload-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .file-picker-btn, .btn-action-upload {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .logo-picker-btn, .logo-upload-btn, .logo-remove-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Store Logo Management Styling */
.store-logo-management-section {
    transition: var(--transition-normal);
}

.store-logo-preview-box {
    animation: fadeIn 0.25s ease;
}

.logo-preview-wrap img {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

/* Mobile Touch-Friendly Price Stepper System */
.mobile-price-stepper {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: #F1F5F9 !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    border: 1.5px solid #CBD5E1 !important;
    min-width: 150px !important;
    white-space: nowrap !important;
}

.btn-step-price {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    border: none !important;
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12) !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: transform 0.1s ease !important;
}

.btn-step-price.btn-minus {
    background: #EF4444 !important;
}

.btn-step-price.btn-plus {
    background: #059669 !important;
}

.btn-step-price:active {
    transform: scale(0.90) !important;
}

.price-input-table {
    width: 65px !important;
    text-align: center !important;
    padding: 0.4rem 0.2rem !important;
    font-size: 0.95rem !important;
    font-weight: 900 !important;
    border-radius: 6px !important;
    border: 1.5px solid #CBD5E1 !important;
    background: white !important;
    color: #0F172A !important;
    -moz-appearance: textfield !important;
}

.price-input-table::-webkit-outer-spin-button,
.price-input-table::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.price-unit-lbl {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    color: #475569 !important;
    margin-right: 2px !important;
}

/* Weekly Working Hours Table Styling */
.weekly-hours-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weekly-day-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.weekly-day-row.is-closed {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.weekly-day-row .day-name {
    font-weight: 800;
    min-width: 100px;
    color: var(--dark-green);
    font-size: 0.95rem;
}

.weekly-day-row .closed-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #DC2626;
    cursor: pointer;
    user-select: none;
}

.weekly-day-row .time-range-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.weekly-day-row input[type="time"] {
    padding: 0.4rem 0.6rem;
    font-weight: 800;
    border-radius: 8px;
    border: 1.5px solid #CBD5E1;
    background: #ffffff;
    font-family: inherit;
    color: #0F172A;
}

.weekly-day-row input[type="time"]:disabled {
    background: #F1F5F9;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Stepper Widget: hide browser native spin arrows on number inputs ───────── */
#editOrderAddProductQty::-webkit-outer-spin-button,
#editOrderAddProductQty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#editOrderAddProductQty[type=number] {
    -moz-appearance: textfield;
}

/* ==========================================================================
   Modern Segmented Tabs & World-Class Admin Dashboard Components
   ========================================================================== */

/* Tabs Navigation Container */
.admin-tabs-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35rem 0.25rem 0.75rem 0.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #E2E8F0;
    scrollbar-width: none;
}

.admin-tabs-nav::-webkit-scrollbar {
    display: none;
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.15rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.92rem;
    border: 1.5px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    touch-action: manipulation;
    flex-shrink: 0;
}

.admin-tab-btn:hover {
    background: #F8FAFC;
    color: var(--primary);
    border-color: #CBD5E1;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, #059669, #047857);
    color: #FFFFFF;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28);
    transform: translateY(-1px);
}

.admin-tab-btn i {
    font-size: 1rem;
}

/* Tab Panes */
.admin-tab-pane {
    animation: tabFadeIn 0.25s ease-out;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern Card Section */
.admin-card-section {
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.admin-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.15rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #F1F5F9;
}

.admin-card-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ECFDF5;
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Unified Form Elements */
.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
}

.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.admin-card-section .form-group {
    margin-bottom: 1rem;
}

.admin-card-section .form-group:last-child {
    margin-bottom: 0;
}

.admin-card-section label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.86rem;
    font-weight: 800;
    color: #334155;
    margin-bottom: 0.4rem;
}

.admin-card-section input[type="text"],
.admin-card-section input[type="tel"],
.admin-card-section input[type="number"],
.admin-card-section input[type="password"],
.admin-card-section select,
.admin-card-section textarea {
    width: 100%;
    height: 46px;
    padding: 0 0.85rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0F172A;
    background: #FFFFFF;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.admin-card-section textarea {
    height: auto;
    padding: 0.75rem 0.85rem;
    line-height: 1.5;
}

.admin-card-section input:focus,
.admin-card-section select:focus,
.admin-card-section textarea:focus {
    border-color: #059669;
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(5, 150, 105, 0.15);
    background: #FAFAFA;
}

/* Save Bar in Form */
.admin-save-bar {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0.9rem 1.15rem;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-save-main {
    background: linear-gradient(135deg, #059669, #047857);
    color: #FFFFFF;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
    transition: all 0.2s ease;
    min-height: 46px;
}

.btn-save-main:hover {
    background: linear-gradient(135deg, #047857, #065F46);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(5, 150, 105, 0.4);
}

.btn-save-main:active {
    transform: scale(0.98);
}

/* Upload and File Actions Row */
.upload-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.upload-action-row .btn {
    min-height: 42px;
}

/* Mobile Optimizations (≤640px) */
@media (max-width: 640px) {
    .admin-navbar {
        padding: 0.5rem 0;
    }

    .admin-nav-container {
        padding: 0 0.6rem;
        gap: 0.5rem;
    }

    .admin-brand {
        min-width: 0;
        flex: 1 1 auto;
    }

    .admin-brand-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .admin-brand-store {
        font-size: 0.74rem;
        line-height: 1.2;
        margin-top: 1px;
    }

    .admin-actions {
        gap: 0.4rem;
    }

    .admin-nav-action-btn {
        height: 35px;
        padding: 0 0.75rem;
        font-size: 0.8rem;
        border-radius: 8px;
        gap: 0.3rem;
    }

    .admin-nav-action-btn i {
        font-size: 0.85rem;
    }

    .admin-pwa-banner {
        padding: 0.65rem 0;
    }

    .pwa-banner-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
        padding: 0 0.75rem;
    }

    .pwa-banner-text {
        gap: 0.6rem;
    }

    .pwa-banner-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .pwa-banner-info strong {
        font-size: 0.86rem;
    }

    .pwa-banner-info p {
        font-size: 0.74rem;
    }

    .btn-pwa-install-action {
        width: 100%;
        padding: 0.55rem;
        font-size: 0.84rem;
        justify-content: center;
    }

    .admin-main {
        margin-top: 0.85rem;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }
    
    .admin-tabs-nav {
        gap: 0.35rem;
        padding-bottom: 0.6rem;
    }
    
    .admin-tab-btn {
        padding: 0.55rem 0.85rem;
        font-size: 0.84rem;
        border-radius: 10px;
    }
    
    .admin-card-section {
        padding: 1rem 0.9rem;
        border-radius: 14px;
        margin-bottom: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.55rem !important;
    }
    
    .admin-stat-card {
        padding: 0.75rem 0.85rem !important;
        gap: 0.6rem !important;
    }
    
    .admin-stat-card i {
        font-size: 1.3rem !important;
    }
    
    .stat-num {
        font-size: 1.25rem !important;
    }
    
    .stat-lbl {
        font-size: 0.72rem !important;
    }
    
    .btn-save-main {
        width: 100%;
        justify-content: center;
    }
}

