/* Admin Page Styles */
.admin-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* iOS safe area support */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@supports (padding: max(0px)) {
    .admin-page {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

.admin-container {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    flex-direction: column;
}

/* Login Screen */
.admin-login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.admin-login-screen.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-login-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.5s ease-out;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #2e7d32;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.admin-login-header h1 {
    font-size: 1.8rem;
    color: #2e7d32;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.admin-login-header p {
    color: #666;
    font-size: 0.95rem;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: #2e7d32;
    width: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.85rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn-admin-login {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-admin-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.3);
}

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

.admin-login-footer {
    margin-top: 2rem;
    text-align: center;
}

.back-to-store {
    color: #2e7d32;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-to-store:hover {
    color: #1b5e20;
    transform: translateX(-3px);
}

/* Dashboard Screen */
.admin-dashboard-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: #f5f7fa;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Hide dashboard when not authenticated */
.admin-dashboard-screen[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.admin-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2e7d32;
}

.admin-header-left h2 {
    font-size: 1.5rem;
    color: #2e7d32;
    margin: 0;
    font-weight: 700;
}

.admin-header-left p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-nav-link,
.admin-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #333;
    font-size: 0.95rem;
}

.admin-nav-link {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

.admin-nav-link:hover {
    background: rgba(46, 125, 50, 0.2);
}

.admin-logout-btn {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.admin-logout-btn:hover {
    background: rgba(244, 67, 54, 0.2);
}

.admin-main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Stats Section */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Hide stats when not authenticated */
.admin-stats[style*="display: none"] {
    display: none !important;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon-products {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-icon-featured {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-icon-categories {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-icon-value {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-icon-orders {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.stat-icon-revenue {
    background: linear-gradient(135deg, #30cfd0, #330867);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.stat-content p {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
}

/* Admin Section */
.admin-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-section-header h2 {
    font-size: 1.5rem;
    color: #2e7d32;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-section-header h2 i {
    color: #ffc107;
}

/* Form Container */
.admin-form-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-product-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.checkbox-group {
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #2e7d32;
}

.checkbox-label span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-new-product,
.btn-seed-catalog {
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.9rem;
}

.btn-new-product {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
}

.btn-new-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.3);
}

.btn-seed-catalog {
    background: linear-gradient(135deg, #ffc107, #ffa000);
    color: #333;
}

.btn-seed-catalog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.3);
}

.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-search {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 0.9rem;
    min-width: 250px;
    transition: all 0.3s ease;
}

.admin-search:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Product List */
.admin-product-list {
    display: grid;
    gap: 1rem;
}

.admin-product-row {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.admin-product-row:hover {
    background: #f0f0f0;
    border-color: #2e7d32;
    transform: translateX(4px);
}

.admin-product-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.admin-product-details img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
}

.admin-product-info h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.admin-product-info p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-featured {
    background: rgba(255, 193, 7, 0.2);
    color: #ffa000;
}

.admin-product-actions {
    display: flex;
    gap: 0.75rem;
}

.admin-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.admin-action-btn.edit {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
}

.admin-action-btn.edit:hover {
    background: rgba(33, 150, 243, 0.2);
    transform: scale(1.1);
}

.admin-action-btn.delete {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.admin-action-btn.delete:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

.admin-hint {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.95rem;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .admin-header-content {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .admin-header-left {
        flex-direction: column;
        text-align: center;
    }

    .admin-header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .admin-nav-text {
        display: none;
    }
    
    .admin-nav-link,
    .admin-logout-btn {
        min-height: 44px; /* iOS minimum touch target */
        min-width: 44px;
        touch-action: manipulation;
    }

    .admin-main {
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .admin-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }

    .admin-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .admin-section-header h2 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions button {
        width: 100%;
        min-height: 48px;
    }

    .admin-product-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-product-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .admin-action-btn {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    .admin-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .admin-search {
        width: 100%;
        min-width: auto;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Better touch targets for admin buttons */
    .btn-new-product,
    .btn-seed-catalog,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        padding: 0.75rem 1.25rem;
    }
    
    /* Form inputs better on mobile */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    /* Order form items better on mobile */
    .order-item-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .order-product-select,
    .order-quantity-input {
        width: 100%;
        min-height: 44px;
    }
}

/* Admin Orders Styles */
.admin-orders-list {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-order-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.admin-order-card:hover {
    border-color: #2e7d32;
    background: #ffffff;
}

.admin-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-order-header h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 0.25rem 0;
}

.admin-order-info {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.order-status-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    background: white;
    transition: all 0.3s ease;
}

.order-status-select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.admin-order-items {
    margin-bottom: 1rem;
}

#admin-contact-list .admin-order-items {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.admin-order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.admin-order-item:last-child {
    border-bottom: none;
}

.admin-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-order-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2e7d32;
}

.admin-order-payment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.admin-order-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-action-link {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    text-decoration: none;
    transition: all 0.3s ease;
}

.admin-action-link:hover {
    background: rgba(46, 125, 50, 0.2);
    transform: scale(1.1);
}

/* Admin Buyers Styles */
.admin-buyers-list {
    margin-top: 1rem;
}

.admin-buyers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.admin-buyer-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.admin-buyer-card:hover {
    border-color: #2e7d32;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-buyer-header h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 0.5rem 0;
}

.admin-buyer-email {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.admin-buyer-email:hover {
    color: #2e7d32;
}

.admin-buyer-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.admin-buyer-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    font-weight: 600;
}

.admin-buyer-stat i {
    color: #2e7d32;
}

.admin-buyer-footer {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-buyer-footer small {
    color: #999;
    font-size: 0.85rem;
}

.admin-buyer-actions {
    display: flex;
    gap: 0.5rem;
}

.admin-buyer-actions .admin-action-link {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Order Creation Form Styles */
.order-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.order-item-row {
    display: grid;
    grid-template-columns: 1fr 100px auto;
    gap: 0.75rem;
    align-items: center;
}

.order-product-select {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.order-product-select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.order-quantity-input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.order-quantity-input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.btn-remove-order-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-remove-order-item:hover {
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

.order-total-display {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.1), rgba(255, 193, 7, 0.1));
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2e7d32;
    text-align: center;
    border: 2px solid #2e7d32;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .admin-buyers-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-order-header {
        flex-direction: column;
    }
    
    .admin-order-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .order-item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .btn-remove-order-item {
        width: 100%;
    }

    /* Contact section mobile optimizations */
    #admin-contact-list .admin-order-card {
        padding: 1rem;
    }

    #admin-contact-list .admin-order-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    #admin-contact-list .admin-order-header > div:last-child {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }

    .contact-status-select {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    #admin-contact-list .admin-order-actions {
        flex-direction: column;
    }

    #admin-contact-list .admin-action-link {
        width: 100%;
        justify-content: center;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Category Management Styles */
.admin-categories-list {
    margin-top: 1rem;
}

.admin-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.admin-category-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.admin-category-card:hover {
    border-color: #2e7d32;
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-category-info h4 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.admin-category-info p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.admin-category-actions {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    .admin-login-screen {
        padding: 1rem;
    }

    .admin-logo {
        width: 80px;
        height: 80px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .admin-product-details {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-categories-grid {
        grid-template-columns: 1fr;
    }

    /* Ensure all inputs have 16px font to prevent iOS zoom */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Ensure all buttons have proper touch targets */
    button,
    .btn-primary,
    .btn-secondary,
    .admin-action-btn,
    .admin-action-link {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(46, 125, 50, 0.2);
    }

    /* Contact section specific */
    #admin-contact-list .admin-order-card {
        padding: 0.75rem;
    }

    #admin-contact-list .admin-order-header h4 {
        font-size: 0.95rem;
    }

    #admin-contact-list .admin-order-info {
        font-size: 0.75rem;
    }
}

/* Blog Management Styles */
.admin-blog-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-blog-row {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.admin-blog-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.admin-blog-info {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    align-items: center;
}

.admin-blog-image {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.admin-blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-blog-details {
    flex: 1;
}

.admin-blog-details h4 {
    font-size: 1.1rem;
    color: #1b5e20;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.admin-blog-excerpt {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-blog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

.admin-blog-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.published-badge {
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.draft-badge {
    background: #ff9800;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-blog-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-blog-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-blog-actions .read {
    background: #2e7d32;
    color: white;
}

.admin-blog-actions .read:hover {
    background: #1b5e20;
    transform: translateY(-2px);
}

.admin-blog-actions .edit {
    background: #2196F3;
    color: white;
}

.admin-blog-actions .edit:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.admin-blog-actions .delete {
    background: #f44336;
    color: white;
}

.admin-blog-actions .delete:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .admin-blog-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-blog-info {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-blog-image {
        width: 100%;
        height: 150px;
    }

    .admin-blog-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Admin Sidebar Styles */
.admin-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, #1b5e20 0%, #2e7d32 100%);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s ease;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.admin-sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.admin-sidebar-header h2 {
    font-size: 1.2rem;
    margin: 0;
    flex: 1;
    color: white;
}

.admin-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    background: none;
    border-right: none;
    border-top: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
}

.admin-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #ffc107;
}

.admin-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: #ffc107;
    font-weight: 600;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.admin-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.admin-logout-item {
    color: rgba(255, 200, 200, 0.9);
}

.admin-logout-item:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #ffcdd2;
    border-left-color: #f44336;
}

.admin-mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #2e7d32;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* Responsive Sidebar */
@media (max-width: 1024px) {
    .admin-content-wrapper {
        margin-left: 0;
    }

    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-mobile-menu-toggle {
        display: block;
    }

    .admin-sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Panza Verde Chatbot Styles */
.panza-chatbot {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    left: auto;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.4);
    transition: all 0.3s ease;
    position: relative;
    bottom: 0;
    right: 0;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(46, 125, 50, 0.5);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    left: auto;
    width: 380px;
    max-width: calc(100vw - 2rem);
    height: 600px;
    max-height: calc(100dvh - 8rem);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chatbot-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-header p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8f9fa;
    -webkit-overflow-scrolling: touch;
}

.chatbot-message {
    margin-bottom: 1rem;
    display: flex;
    animation: fadeInUp 0.3s ease;
}

.user-message {
    justify-content: flex-end;
}

.bot-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.typing-indicator {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chatbot-input-container input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    min-height: 44px;
}

.chatbot-input-container input:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.chatbot-input-container input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.chatbot-input-container button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-input-container button:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.chatbot-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Chatbot Responsive - Enhanced for mobile priority */
@media (max-width: 768px) {
    .panza-chatbot {
        bottom: max(1rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
        left: auto;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        font-size: 1.3rem;
    }

    .chatbot-window {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        height: calc(100vh - 8rem);
        max-height: calc(100dvh - 8rem);
        bottom: 70px;
        right: 1rem;
        left: auto;
        border-radius: 20px 20px 0 0;
    }

    .chatbot-messages {
        padding: 1rem;
    }

    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 0.65rem 0.85rem;
    }

    .chatbot-header {
        padding: 1rem;
    }

    .chatbot-logo {
        width: 40px;
        height: 40px;
    }

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

    .chatbot-header p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .panza-chatbot {
        bottom: 0;
        right: 0;
        left: auto;
    }

    .chatbot-toggle {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        font-size: 1.2rem;
        bottom: max(1rem, env(safe-area-inset-bottom));
        right: max(1rem, env(safe-area-inset-right));
        left: auto;
    }

    .chatbot-window {
        width: 100vw;
        max-width: 100vw;
        height: calc(100vh - 4rem);
        max-height: calc(100dvh - 4rem);
        bottom: 0;
        right: 0;
        left: auto;
        border-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .chatbot-header {
        border-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .message-content {
        max-width: 90%;
        font-size: 0.85rem;
    }

    .chatbot-input-container {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* ==================== INVENTORY MANAGEMENT STYLES ==================== */
.admin-inventory-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.admin-inventory-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #2e7d32;
    transition: all 0.3s ease;
}

.admin-inventory-row.low-stock {
    border-left-color: #f44336;
    background: #fff3f3;
}

.admin-inventory-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.admin-inventory-info h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.admin-inventory-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.inventory-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background: #fff3e0;
    color: #f57c00;
}

.inventory-notes {
    margin-top: 0.5rem;
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

.admin-inventory-actions {
    display: flex;
    gap: 0.5rem;
}

/* ==================== ANALYTICS DASHBOARD STYLES ==================== */
.analytics-dashboard {
    margin-top: 2rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.analytics-card h4 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.analytics-change {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

.analytics-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container h4 {
    margin: 0 0 1rem 0;
    color: #333;
}

.low-stock-item {
    padding: 1rem;
    background: #fff3f3;
    border-left: 4px solid #f44336;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.low-stock-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #333;
}

.stock-warning {
    color: #f44336;
    font-weight: 500;
}

/* ==================== INSIGHTS MODAL STYLES ==================== */
.insights-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

.insights-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.insights-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.insights-modal-header h3 {
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.insights-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.insights-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.insights-content {
    line-height: 1.6;
    color: #333;
}

.insights-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
}

/* ==================== TUTORIAL STYLES ==================== */
.tutorial-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem;
}

.tutorial-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 1rem;
}

.tutorial-tab {
    padding: 0.75rem 1.5rem;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tutorial-tab:hover {
    background: #e0e0e0;
    color: #333;
}

.tutorial-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tutorial-content {
    position: relative;
    min-height: 400px;
}

.tutorial-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-section.active {
    display: block;
}

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

.tutorial-section h3 {
    color: #333;
    margin-top: 0;
    margin-bottom: 1rem;
}

.tutorial-section h4 {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.tutorial-section ul,
.tutorial-section ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.tutorial-section li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.tutorial-section pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.ai-generated-help {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.ai-generated-help h4 {
    color: #667eea;
    margin-top: 0;
}

/* ==================== RESPONSIVE STYLES ==================== */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-charts {
        grid-template-columns: 1fr;
    }

    .insights-modal {
        padding: 1rem;
    }

    .insights-modal-content {
        max-height: 95vh;
    }

    .tutorial-nav {
        flex-direction: column;
    }

    .tutorial-tab {
        width: 100%;
        justify-content: center;
    }

    .admin-inventory-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-inventory-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==================== LOADING SCREEN ANIMATIONS ==================== */
.admin-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.loading-container {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 2rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.loading-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: white;
    padding: 10px;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 2rem auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: rgba(255, 255, 255, 0.7);
    animation-duration: 1s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 50%;
    height: 50%;
    top: 25%;
    left: 25%;
    border-top-color: rgba(255, 255, 255, 0.5);
    animation-duration: 0.75s;
}

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

.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 2rem;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: dotPulse 1.4s infinite;
    opacity: 0;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

/* ==================== WELCOME ANIMATION ==================== */
.welcome-animation {
    position: relative;
    display: inline-block;
}

.welcome-animation.animate-welcome {
    animation: welcomeSlideIn 0.8s ease-out;
}

.erandina-text {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    position: relative;
}

.erandina-text.sparkle-animation::before,
.erandina-text.sparkle-animation::after {
    content: '✨';
    position: absolute;
    font-size: 0.8em;
    animation: sparkle 2s ease-in-out infinite;
}

.erandina-text.sparkle-animation::before {
    left: -20px;
    animation-delay: 0s;
}

.erandina-text.sparkle-animation::after {
    right: -20px;
    animation-delay: 1s;
}

@keyframes welcomeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

/* ==================== DASHBOARD FADE-IN ANIMATION ==================== */
.dashboard-fade-in {
    animation: dashboardFadeIn 0.6s ease-out;
}

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

.stats-fade-in {
    animation: statsFadeIn 0.8s ease-out 0.3s both;
}

@keyframes statsFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== ENHANCED DASHBOARD EXPERIENCE ==================== */
.admin-dashboard-screen {
    animation: dashboardFadeIn 0.6s ease-out;
}

.admin-section {
    transition: all 0.3s ease;
}

.admin-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card {
    transition: all 0.3s ease;
    animation: cardFadeIn 0.5s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }

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

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.admin-nav-item {
    transition: all 0.3s ease;
    position: relative;
}

.admin-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.admin-nav-item.active::before {
    height: 60%;
}

.admin-nav-item:hover {
    transform: translateX(5px);
    background: rgba(102, 126, 234, 0.1);
}

/* ==================== SMOOTH SCROLLING ==================== */
html {
    scroll-behavior: smooth;
}

/* ==================== ENHANCED BUTTONS ==================== */
.btn-primary,
.btn-secondary,
.btn-new-product {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before,
.btn-new-product::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-new-product:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-new-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ==================== ENHANCED CHATBOT TOGGLE ==================== */
.chatbot-toggle {
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 30px rgba(46, 125, 50, 0.6);
}

.chatbot-toggle.active {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(46, 125, 50, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(46, 125, 50, 0.8);
    }
}

/* ==================== CONNECTION STATUS INDICATOR ==================== */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.connection-status.connected {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
}

.connection-status.connected i {
    color: #2e7d32;
    animation: pulse-green 2s ease-in-out infinite;
}

.connection-status.offline {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
}

.connection-status.offline i {
    color: #f44336;
}

.connection-status.syncing {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.connection-status.syncing i {
    color: #ff9800;
    animation: pulse-orange 1.5s ease-in-out infinite;
}

.connection-status i {
    font-size: 0.6rem;
    margin-right: 0.25rem;
}

.connection-text {
    font-size: 0.85rem;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-orange {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@media (max-width: 768px) {
    .connection-status {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        margin-right: 0.5rem;
    }

    .connection-text {
        display: none;
    }
}

/* ==================== RESPONSIVE LOADING SCREEN ==================== */
@media (max-width: 768px) {
    .loading-logo img {
        width: 100px;
        height: 100px;
    }

    .loading-spinner {
        width: 60px;
        height: 60px;
    }

    .loading-text {
        font-size: 1rem;
    }

    .erandina-text.sparkle-animation::before,
    .erandina-text.sparkle-animation::after {
        font-size: 0.6em;
    }

    .erandina-text.sparkle-animation::before {
        left: -15px;
    }

    .erandina-text.sparkle-animation::after {
        right: -15px;
    }
}

/* ==================== BLOG VIEW MODAL (Admin) ==================== */
.blog-view-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.blog-view-content {
    max-width: 800px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideInDown 0.3s ease-out;
}

.blog-view-header {
    background: var(--primary-color, #2e7d32);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-view-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.blog-view-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.blog-view-close:hover {
    transform: rotate(90deg);
    opacity: 0.8;
}

.blog-view-body {
    padding: 1.5rem;
}

.blog-view-image {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.blog-view-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

.blog-view-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.blog-view-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.blog-view-excerpt {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(46, 125, 50, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color, #2e7d32);
}

.blog-view-content-text {
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .blog-view-content {
        margin: 1rem;
        border-radius: 8px;
    }

    .blog-view-header {
        padding: 1rem;
    }

    .blog-view-header h2 {
        font-size: 1.2rem;
    }

    .blog-view-body {
        padding: 1rem;
    }

    .blog-view-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .blog-view-modal {
        padding: 0.5rem;
    }

    .blog-view-content {
        margin: 0.5rem;
    }

    .blog-view-image img {
        max-height: 250px;
    }
}

/* ==================== CONTACT SUBMISSIONS STATUS BADGES ==================== */
.new-badge {
    background: rgba(33, 150, 243, 0.1);
    color: #2196f3;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.read-badge {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.replied-badge {
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.contact-status-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--medium-gray, #e0e0e0);
    border-radius: 8px;
    font-size: 0.9rem;
    min-height: 44px; /* iOS minimum touch target */
    cursor: pointer;
    transition: var(--transition, all 0.3s ease);
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
    min-width: 120px;
}

.contact-status-select:focus {
    outline: none;
    border-color: var(--primary-color, #2e7d32);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Contact Section Specific Styles */
#admin-contact-list .admin-order-card {
    margin-bottom: 1.5rem;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

#admin-contact-list .admin-order-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

#admin-contact-list .admin-order-header > div:first-child {
    width: 100%;
}

#admin-contact-list .admin-order-header > div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

#admin-contact-list .admin-order-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

#admin-contact-list .admin-order-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

#admin-contact-list .admin-order-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    position: relative;
}

#admin-contact-list .admin-order-item:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#admin-contact-list .admin-order-item strong {
    font-size: 0.9rem;
    color: #333;
}

#admin-contact-list .admin-order-item p {
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
    color: #555;
}

#admin-contact-list .admin-order-item a {
    color: var(--primary-color, #2e7d32);
    text-decoration: none;
    word-break: break-all;
    font-size: 0.85rem;
}

#admin-contact-list .admin-order-item a:hover {
    text-decoration: underline;
}

#admin-contact-list .admin-order-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    clear: both;
    position: relative;
    z-index: 1;
}

#admin-contact-list .admin-order-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
    z-index: 2;
}

#admin-contact-list .admin-action-link {
    min-height: 44px; /* iOS minimum touch target */
    min-width: 44px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(46, 125, 50, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border-radius: 8px;
    background: rgba(46, 125, 50, 0.1);
    color: #2e7d32;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: visible;
}

#admin-contact-list .admin-action-link:hover,
#admin-contact-list .admin-action-link:active {
    background: rgba(46, 125, 50, 0.2);
    transform: scale(1.05);
}

#admin-contact-list .delete-contact {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(244, 67, 54, 0.2);
}

/* Contact Search Input */
#contact-search {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--medium-gray, #e0e0e0);
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px; /* iOS minimum touch target */
    touch-action: manipulation;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#contact-search:focus {
    outline: none;
    border-color: var(--primary-color, #2e7d32);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Mobile Optimizations for Contact Section */
@media (max-width: 768px) {
    #admin-contact-list .admin-order-card {
        padding: 1rem;
        border-radius: 8px;
    }

    #admin-contact-list .admin-order-header {
        gap: 0.5rem;
    }

    #admin-contact-list .admin-order-header h4 {
        font-size: 1rem;
    }

    #admin-contact-list .admin-order-info {
        font-size: 0.8rem;
    }

    #admin-contact-list .admin-order-info span {
        flex-wrap: wrap;
    }

    #admin-contact-list .admin-order-header > div:last-child {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-status-select {
        width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    #admin-contact-list .admin-order-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    #admin-contact-list .admin-action-link {
        width: 100%;
        justify-content: center;
        font-size: 16px; /* Prevents zoom on iOS */
        margin: 0;
        flex: 1 1 100%;
        min-width: 100%;
        box-sizing: border-box;
    }

    #admin-contact-list .admin-order-footer {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }

    #contact-search {
        width: 100%;
        max-width: 100%;
    }

    .new-badge,
    .read-badge,
    .replied-badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
}

@media (max-width: 480px) {
    #admin-contact-list .admin-order-card {
        padding: 0.75rem;
    }

    #admin-contact-list .admin-order-header h4 {
        font-size: 0.95rem;
    }

    #admin-contact-list .admin-order-info {
        font-size: 0.75rem;
    }

    #admin-contact-list .admin-order-item {
        font-size: 0.85rem;
    }

    #admin-contact-list .admin-order-item p {
        font-size: 0.8rem;
    }
}

/* iOS Safe Area Support for Contact Section */
@supports (padding: max(0px)) {
    #admin-contact-list .admin-order-card {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

