/* Enhanced Inventory Manager Styles */

.iam-enhanced {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.iam-access-denied {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin: 20px;
}

/* Header */
.iam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
}

.iam-title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.iam-title p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 16px;
}

.iam-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.iam-btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.iam-btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.iam-btn-secondary {
    background: #f8f9fa;
    color: #495057;
}

.iam-btn-outline {
    background: transparent;
    border: 2px solid #dee2e6;
    color: #495057;
}

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

.iam-stat-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.iam-stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.iam-stat-label {
    color: #6c757d;
    font-size: 14px;
}

/* Products Grid */
.iam-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.iam-product-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.iam-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.iam-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.iam-product-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.iam-product-info h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.iam-product-info h3 a:hover {
    color: #667eea;
}

.iam-product-sku {
    display: block;
    background: #e9ecef;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 5px;
    width: fit-content;
}

.iam-product-category {
    color: #6c757d;
    font-size: 14px;
}

.iam-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.iam-status-active {
    background: #d4edda;
    color: #155724;
}

.iam-status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Stock Display */
.iam-product-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.iam-stock-number {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

.iam-stock-number.low-stock {
    color: #dc3545;
    animation: pulse 2s infinite;
}

.iam-stock-label {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 2px;
}

.iam-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.iam-unit-cost {
    display: block;
    color: #6c757d;
    font-size: 12px;
}

/* Product Actions */
.iam-product-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.iam-stock-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.iam-btn-stock {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.iam-btn-plus {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.iam-btn-minus {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    color: white;
}

.iam-btn-stock:hover {
    transform: scale(1.1);
}

.iam-qty-input {
    width: 60px;
    height: 35px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.iam-action-buttons {
    display: flex;
    gap: 10px;
}

.iam-action-buttons .iam-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
}

/* Modal */
.iam-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.iam-modal-content {
    background: white;
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.iam-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #dee2e6;
}

.iam-modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.iam-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.iam-close:hover {
    color: #000;
}

.iam-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 30px;
    padding-bottom: 0;
}

.iam-form-grid input,
.iam-form-grid select {
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
}

.iam-form-grid textarea {
    grid-column: 1 / -1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    resize: vertical;
    margin-top: 15px;
}

.iam-modal-content form button {
    margin: 0 30px 30px 30px;
    width: calc(100% - 60px);
}

/* Profile Page */
.iam-profile {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.iam-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.iam-back-btn {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.iam-profile-title h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
}

.iam-profile-sku {
    color: #6c757d;
    font-size: 14px;
}

.iam-profile-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

.iam-profile-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.iam-profile-card h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
}

.iam-stock-current {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.iam-stock-details p {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
}

.iam-quick-actions h4 {
    margin: 20px 0 10px 0;
    color: #495057;
}

.iam-profile-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.iam-profile-card input,
.iam-profile-card select,
.iam-profile-card textarea {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}

/* Timeline */
.iam-history-timeline {
    position: relative;
    padding-left: 30px;
}

.iam-timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f1f3f4;
}

.iam-timeline-item:last-child {
    border-bottom: none;
}

.iam-timeline-marker {
    position: absolute;
    left: -37px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #667eea;
}

.iam-marker-stock_in {
    background: #28a745;
}

.iam-marker-stock_out {
    background: #dc3545;
}

.iam-marker-created {
    background: #17a2b8;
}

.iam-marker-updated {
    background: #ffc107;
}

.iam-timeline-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.iam-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.iam-timeline-action {
    font-weight: 600;
    color: #2c3e50;
}

.iam-timeline-date {
    color: #6c757d;
    font-size: 12px;
}

.iam-timeline-details p {
    margin: 5px 0;
    font-size: 14px;
    color: #495057;
}

.iam-no-history {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
}

/* Search Bar */
.iam-search-bar {
    margin-bottom: 30px;
}

.iam-search-bar input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 16px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.iam-search-bar input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .iam-enhanced {
        padding: 10px;
    }
    
    .iam-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .iam-products-grid {
        grid-template-columns: 1fr;
    }
    
    .iam-profile-content {
        grid-template-columns: 1fr;
    }
    
    .iam-form-grid {
        grid-template-columns: 1fr;
    }
}