/* Sales Manager Styles */

:root {
    /* Unified admin colors - matching all other admin pages */
    --admin-primary: #2C5282;
    --admin-secondary: #FFAB02;
    --admin-success: #48BB78;
    --admin-warning: #ED8936;
    --admin-error: #E53E3E;
    --admin-bg: #F7FAFC;
    --admin-card: #FFFFFF;
    --admin-border: #E2E8F0;
    --admin-text: #2D3748;
    --admin-text-light: #718096;
    --admin-shadow: rgba(0, 0, 0, 0.1);
    --admin-shadow-hover: rgba(0, 0, 0, 0.15);

    /* Sales-specific accent color */
    --sales-accent: #48BB78;
    --sales-gradient: linear-gradient(135deg, var(--admin-primary), var(--sales-accent));
}

/* Base Styles */
body {
    background: var(--admin-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* Navigation - ensure proper sizing */
.nav {
    background: var(--admin-card);
    border-bottom: 1px solid var(--admin-border);
    box-shadow: 0 2px 10px var(--admin-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-title {
    color: var(--admin-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--admin-text);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--admin-border);
    color: var(--admin-primary);
}

.nav-link.active {
    background: var(--admin-primary);
    color: white;
}

.back-to-site {
    background: var(--admin-secondary);
    color: white !important;
    font-weight: 600;
}

.back-to-site:hover {
    background: #E69500;
}

.auth-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--admin-error);
    text-decoration: none;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.auth-nav-link:hover {
    background: rgba(229, 62, 62, 0.1);
}

/* Mobile Toggle - Hidden by default, shown on mobile or with 5+ features */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Show hamburger when customer has 5+ features (even on desktop) */
.nav-container.has-many-features .mobile-toggle {
    display: flex;
}

/* Show hamburger when customer has 5+ features, hide some nav links on desktop */
.nav-container.has-many-features .nav-links {
    display: flex;
}

@media (min-width: 769px) {
    .nav-container.has-many-features .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--admin-card);
        border-top: 1px solid var(--admin-border);
        box-shadow: 0 2px 10px var(--admin-shadow);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-container.has-many-features .nav-links.active {
        transform: translateX(0);
    }

    .nav-container.has-many-features .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }
}

.mobile-toggle span {
    width: 100%;
    height: 3px;
    background: var(--admin-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile responsive nav */
@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--admin-card);
        border-top: 1px solid var(--admin-border);
        box-shadow: 0 2px 10px var(--admin-shadow);
        flex-direction: column;
        padding: 1rem 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: 0;
    }
}

/* Main Container */
.sales-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 70px);
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--admin-border);
    border-top-color: var(--admin-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Access State */
.no-access-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.access-prompt {
    max-width: 600px;
    text-align: center;
    background: var(--admin-card);
    padding: 3rem 2rem;
    border-radius: 16px;
    box-shadow: var(--admin-shadow);
}

.access-prompt h2 {
    color: var(--admin-text);
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.access-prompt > p {
    color: var(--admin-text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.feature-benefits {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.benefit {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.benefit-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.benefit h4 {
    margin: 0 0 0.25rem 0;
    color: var(--admin-text);
    font-size: 1rem;
}

.benefit p {
    margin: 0;
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

.upgrade-btn {
    background: var(--admin-primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

/* Sales Panel */
.sales-panel {
    animation: fadeIn 0.3s ease-in;
}

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

/* Header */
.sales-header {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--admin-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.header-content h1 {
    margin: 0 0 0.5rem 0;
    color: var(--admin-text);
    font-size: 2rem;
}

.header-content p {
    margin: 0;
    color: var(--admin-text-light);
    font-size: 1rem;
}

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

.primary-btn, .secondary-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    white-space: nowrap;
}

.primary-btn {
    background: var(--admin-primary);
    color: white;
}

.primary-btn:hover {
    background: #1e3a5f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.3);
}

.secondary-btn {
    background: var(--admin-card);
    color: var(--admin-text);
    border: 2px solid var(--admin-border);
}

.secondary-btn:hover {
    background: var(--admin-bg);
    border-color: var(--admin-primary);
}

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

.stat-item {
    background: var(--admin-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--admin-shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--admin-shadow-hover);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--admin-primary);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--admin-text-light);
    font-size: 0.875rem;
    font-weight: 500;
    display: block;
}

.storage-stat {
    cursor: pointer;
}

.storage-clickable {
    display: block;
    margin-top: 0.5rem;
    color: var(--admin-primary);
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.7;
}

/* Search and Filter Bar */
.search-filter-bar {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--admin-shadow);
}

.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-light);
    font-size: 1.25rem;
    pointer-events: none;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.clear-filters {
    padding: 0.75rem 1.5rem;
    background: var(--admin-card);
    color: var(--admin-text);
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: var(--admin-bg);
    border-color: var(--admin-error);
    color: var(--admin-error);
}

/* Sales Container */
.sales-container {
    min-height: 400px;
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--admin-card);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--admin-text);
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0 0 2rem 0;
    color: var(--admin-text-light);
    max-width: 500px;
    line-height: 1.6;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--admin-shadow);
    display: flex;
    gap: 1rem;
    transition: transform 0.2s;
}

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

.stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--admin-text);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--admin-text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: var(--admin-bg);
    display: inline-block;
}

.stat-change.positive {
    color: var(--admin-success);
    background: rgba(72, 187, 120, 0.1);
}

.stat-urgent {
    color: var(--admin-error);
    font-size: 0.875rem;
}

.stat-extra {
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

/* Activity Section */
.activity-section {
    background: var(--admin-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--admin-shadow);
}

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

.section-header h3 {
    margin: 0;
    color: var(--admin-text);
}

.view-all-btn {
    background: transparent;
    border: 1px solid var(--admin-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--admin-text);
    transition: all 0.2s;
}

.view-all-btn:hover {
    background: var(--admin-bg);
}

/* Tab Container */
.tab-container {
    background: var(--admin-card);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--admin-border);
    background: var(--admin-bg);
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-text-light);
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    background: rgba(0,0,0,0.05);
}

.tab-btn.active {
    color: var(--admin-primary);
    background: var(--admin-card);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--admin-primary);
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Toolbar */
.content-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

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

.form-control {
    padding: 0.5rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--admin-card);
}

/* Products List */
#productsList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
}

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

.product-card.inactive {
    opacity: 0.6;
}

.product-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--admin-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

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

.product-info {
    padding: 1rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.product-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--admin-text);
    flex: 1;
}

.badge-referenced {
    background: var(--admin-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: help;
}

.product-type {
    color: var(--admin-text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--admin-primary);
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.875rem;
    color: var(--admin-text-light);
}

.product-stock.out-of-stock {
    color: var(--admin-error);
    font-weight: 500;
}

.product-inactive-badge {
    background: var(--admin-warning);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 0.5rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--admin-border);
    background: var(--admin-bg);
}

.btn-edit, .btn-toggle, .btn-delete {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-edit {
    background: var(--admin-secondary);
    color: white;
}

.btn-edit:hover {
    background: #1976D2;
}

.btn-toggle {
    background: var(--admin-warning);
    color: white;
}

.btn-toggle:hover {
    background: #F57C00;
}

.btn-delete {
    background: var(--admin-error);
    color: white;
}

.btn-delete:hover {
    background: #D32F2F;
}

/* Orders List */
#ordersList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.order-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.order-main {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex: 1;
}

.order-id {
    min-width: 120px;
}

.order-id strong {
    display: block;
    color: var(--admin-text);
    margin-bottom: 0.25rem;
}

.order-date {
    font-size: 0.75rem;
    color: var(--admin-text-light);
}

.order-customer {
    min-width: 150px;
    color: var(--admin-text);
}

.order-items-count {
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

.order-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.order-total {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--admin-text);
    min-width: 80px;
    text-align: right;
}

.order-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--admin-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--admin-text-light);
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: #1e3a5f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
}

.btn-secondary:hover {
    background: var(--admin-bg);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: var(--admin-card);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content.large-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

.modal-header h2 {
    margin: 0;
    color: var(--admin-text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--admin-text-light);
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.close-btn:hover {
    background: var(--admin-bg);
    color: var(--admin-text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--admin-bg);
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.form-section h4 {
    margin: 0 0 1rem 0;
    color: var(--admin-text);
    font-size: 1.1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--admin-text);
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    color: var(--admin-text);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    background: white;
}

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

/* Image Dropzone */
.image-dropzone {
    border: 2px dashed var(--admin-border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--admin-bg);
}

.image-dropzone:hover {
    border-color: var(--admin-primary);
    background: rgba(44, 82, 130, 0.05);
}

.image-dropzone.dragover {
    border-color: var(--admin-primary);
    background: rgba(44, 82, 130, 0.1);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.dropzone-icon {
    font-size: 3rem;
}

.dropzone-text p {
    margin: 0.25rem 0;
    color: var(--admin-text);
}

.dropzone-subtext {
    color: var(--admin-text-light);
    font-size: 0.875rem;
}

.browse-link {
    color: var(--admin-primary);
    cursor: pointer;
    text-decoration: underline;
}

.image-preview {
    position: relative;
}

.image-preview img {
    width: 100%;
    border-radius: 8px;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-change, .btn-remove {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-change {
    background: var(--admin-secondary);
    color: white;
}

.btn-remove {
    background: var(--admin-error);
    color: white;
}

/* Upload Progress */
.upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--admin-border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--admin-primary);
    transition: width 0.3s ease;
}

/* Order Details */
.order-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--admin-border);
}

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

.order-section h4 {
    margin: 0 0 1rem 0;
    color: var(--admin-text);
}

.order-section p {
    margin: 0.25rem 0;
    color: var(--admin-text);
}

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

.order-number {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--admin-text);
}

.order-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--admin-primary);
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--admin-bg);
    border-radius: 6px;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-price {
    font-weight: bold;
    color: var(--admin-text);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Main container */
    .sales-main {
        padding: 1rem 0.5rem;
    }

    /* Header */
    .sales-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .primary-btn, .secondary-btn {
        width: 100%;
        justify-content: center;
    }

    /* Stats Bar */
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .stat-item {
        padding: 0.5rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    /* Search and Filter */
    .search-filter-bar {
        padding: 1rem;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-select, .clear-filters {
        width: 100%;
    }

    /* Empty States */
    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.25rem;
    }

    /* Old styles */
    .stats-section {
        grid-template-columns: 1fr;
    }

    #productsList {
        grid-template-columns: 1fr;
    }

    .order-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .order-right {
        width: 100%;
        justify-content: space-between;
    }

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

    .tab-nav {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-message {
    color: var(--admin-text);
    font-weight: 500;
}

.notification.success {
    border-left: 4px solid var(--admin-success);
}

.notification.error {
    border-left: 4px solid var(--admin-error);
}

.notification.warning {
    border-left: 4px solid var(--admin-warning);
}

.notification.info {
    border-left: 4px solid var(--admin-secondary);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Image Source Tabs */
.image-source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--admin-border);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--admin-text-light);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--admin-primary);
    background: rgba(44, 82, 130, 0.05);
}

.tab-btn.active {
    color: var(--admin-primary);
    border-bottom-color: var(--admin-primary);
}

.image-tab {
    min-height: 250px;
}

/* Existing Images Grid */
.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--admin-bg);
    border-radius: 8px;
}

.existing-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    background: white;
}

.existing-image-item:hover {
    border-color: var(--admin-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--admin-shadow-hover);
}

.existing-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 0.5rem;
    color: white;
}

.image-title {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-type {
    font-size: 0.65rem;
    opacity: 0.8;
}

.loading-images, .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--admin-text-light);
}

.existing-images-grid .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
}

.existing-images-grid .empty-state p {
    margin: 0.5rem 0;
    color: var(--admin-text-light);
}

/* Storage Warning States */
.storage-stat.storage-warning {
    background: rgba(237, 137, 54, 0.1);
    border: 2px solid var(--admin-warning);
}

.storage-stat.storage-warning .stat-number {
    color: var(--admin-warning);
}

.storage-stat.storage-critical {
    background: rgba(229, 62, 62, 0.1);
    border: 2px solid var(--admin-error);
    animation: pulse 2s infinite;
}

.storage-stat.storage-critical .stat-number {
    color: var(--admin-error);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.storage-clickable {
    display: block;
    font-size: 0.7rem;
    color: var(--admin-primary);
    margin-top: 0.25rem;
    opacity: 0.8;
}
