﻿/* Main Content */
.main-wrapper {
    margin-left: 122px;
    margin-top: 16px;
    min-height: calc(100vh - var(--header-height));
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: var(--text-secondary);
}

/* Search & Filters */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
    }

/* Table */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table thead {
        background: linear-gradient(135deg, #2d5f7f 0%, #1e4159 100%);
        color: white;
    }

    .data-table th {
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .data-table td {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table tbody tr:hover {
        background: #f8f9fa;
    }

.item-image-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

    .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

.btn-success {
    background: var(--secondary-color);
    color: white;
}

.btn-primary {
    background: #2d5f7f;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Modal - Large */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 2rem 0;
}

    .modal.show {
        display: flex;
    }

.modal-dialog {
    background: white;
    border-radius: var(--radius-md);
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    margin: auto;
}

.modal-header {
    background: linear-gradient(135deg, #2d5f7f 0%, #1e4159 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }

.modal-body {
    padding: 2rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

    .form-label.required::after {
        content: ' *';
        color: var(--danger-color);
    }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

/* Image Upload Section */
.image-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-upload-box {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    background: #f8f9fa;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
}

/* Barcode Section */
.barcode-section {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.barcode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.barcode-list {
    max-height: 200px;
    overflow-y: auto;
}

.barcode-item {
    background: #f8f9fa;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .barcode-item.selected {
        background: #e3f2fd;
        border-left: 3px solid var(--primary-color);
    }

.barcode-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    background: white;
}

@media (max-width: 1024px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
