/* ========================================
   STOCK MANAGEMENT STYLES
   ======================================== */

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

/* Status breakdown card (Out of Stock, Returned, Discontinued, Other) */
.stat-card-status-breakdown .stat-content {
    min-width: 0;
}

.stat-status-title {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-status-breakdown .stat-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.stat-status-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.stat-status-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
}

.stat-status-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

/* Filters Section */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.filters-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range span {
    color: #718096;
    font-size: 0.875rem;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Table Section */
.table-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

/* SKU Badge */
.sku-badge {
    background: #e6fffa;
    color: #234e52;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Type Badges */
.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.type-watch {
    background: #dbeafe;
    color: #1e40af;
}

.type-pendant {
    background: #fef3c7;
    color: #92400e;
}

.type-ring {
    background: #fce7f3;
    color: #be185d;
}

.type-bracelet {
    background: #d1fae5;
    color: #065f46;
}

.type-earrings {
    background: #e0e7ff;
    color: #3730a3;
}

.type-necklace {
    background: #fef2f2;
    color: #dc2626;
}

.type-other {
    background: #f3f4f6;
    color: #374151;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-instock {
    background: #d1fae5;
    color: #065f46;
}

.status-sold {
    background: #fef2f2;
    color: #dc2626;
}

.status-reserved {
    background: #fef3c7;
    color: #92400e;
}

.status-discontinued {
    background: #f3f4f6;
    color: #374151;
}

/* Price Styling */
.price {
    font-weight: 600;
    color: #2d3748;
}

.price.sold {
    color: #38a169;
}

.price.profit {
    color: #38a169;
}

.price.loss {
    color: #e53e3e;
}

.percentage.profit {
    color: #38a169;
}

.percentage.loss {
    color: #e53e3e;
}

/* Item Description */
.item-description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-group .form-text {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.25rem;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group-text {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-right: none;
    padding: 0.5rem 0.75rem;
    color: #4a5568;
    font-weight: 500;
    border-radius: 6px 0 0 6px;
}

.input-group .form-control {
    border-radius: 0 6px 6px 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

/* Details View */
.details-container {
    display: grid;
    gap: 2rem;
}

.details-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background: #f7fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    padding: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.info-item span,
.info-item p {
    color: #2d3748;
    font-weight: 500;
}

.info-item p {
    margin: 0;
    line-height: 1.5;
}

/* Loading and Error States */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #718096;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: #e53e3e;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h3 {
    color: #e53e3e;
    margin-bottom: 0.5rem;
}

/* Photo Upload Styles */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.photo-preview-item {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.photo-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.photo-remove:hover {
    opacity: 1;
}

/* Dashboard Styles */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.metric-card.primary {
    border-left-color: #667eea;
}

.metric-card.success {
    border-left-color: #48bb78;
}

.metric-card.warning {
    border-left-color: #ed8936;
}

.metric-card.info {
    border-left-color: #4299e1;
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.metric-card.primary .metric-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.metric-card.success .metric-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.metric-card.warning .metric-icon {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.metric-card.info .metric-icon {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.financial-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.2s ease;
}

.financial-card:hover {
    transform: translateY(-1px);
}

.financial-card.profit {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

.financial-card.loss {
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.financial-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.financial-card.profit .financial-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.financial-card.loss .financial-icon {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.financial-content {
    flex: 1;
}

.financial-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.financial-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.distribution-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.distribution-card:hover {
    transform: translateY(-1px);
}

.distribution-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 0.75rem;
}

.distribution-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.distribution-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.status-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s ease;
    border: 1px solid transparent;
}

.status-card:hover {
    transform: translateY(-1px);
}

.status-card.status-instock {
    background: #f0fff4;
    border-color: #c6f6d5;
}

.status-card.status-sold {
    background: #fff5f5;
    border-color: #fed7d7;
}

.status-card.status-reserved {
    background: #fffbeb;
    border-color: #fde68a;
}

.status-card.status-outofstock {
    background: #f7fafc;
    border-color: #e2e8f0;
}

.status-card.status-damaged {
    background: #fff5f5;
    border-color: #fed7d7;
}

.status-card.status-returned {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.status-card.status-discontinued {
    background: #f7fafc;
    border-color: #e2e8f0;
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto 0.75rem;
}

.status-card.status-instock .status-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.status-card.status-sold .status-icon {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.status-card.status-reserved .status-icon {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.status-card.status-outofstock .status-icon {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.status-card.status-damaged .status-icon {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

.status-card.status-returned .status-icon {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.status-card.status-discontinued .status-icon {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.status-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.status-label {
    font-size: 0.75rem;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.action-card {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.action-card:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.action-content {
    flex: 1;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.action-description {
    font-size: 0.875rem;
    color: #718096;
}

/* Table Responsive Wrapper */
.table-responsive-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-responsive {
    overflow-x: auto;
    min-width: 100%;
}

.stock-table {
    min-width: 900px;
}

/* Column Hiding Classes */
.hide-on-medium {
    display: table-cell;
}

.hide-on-small {
    display: table-cell;
}

/* Responsive Design - Medium Screens */
@media (max-width: 1400px) {
    .hide-on-medium {
        display: none;
    }
}

@media (max-width: 1024px) {
    .hide-on-small {
        display: none;
    }
    
    .stock-table {
        min-width: 700px;
    }
}

/* Responsive Design - Small Screens */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive-wrapper {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .table-responsive {
        overflow-x: auto;
        min-width: 100%;
    }
    
    .stock-table {
        min-width: 900px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .financial-grid {
        grid-template-columns: 1fr;
    }
    
    .distribution-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}
