/* ============================================================
   Packaging Data Import System - Custom Styles
   ============================================================ */

/* ---- Import Page ---- */
.packaging-import-zone {
    border: 3px dashed #005fa7;
    border-radius: 16px;
    background: #f0f7ff;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.packaging-import-zone:hover,
.packaging-import-zone.drag-over {
    border-color: #00a8b0;
    background: #e8f8fa;
    transform: scale(1.01);
}

.packaging-import-zone .icon {
    font-size: 64px;
    color: #005fa7;
    margin-bottom: 16px;
}

.packaging-import-zone h4 {
    color: #023a69;
    font-weight: 700;
}

.packaging-import-zone p {
    color: #707272;
    font-size: 14px;
}

.packaging-import-zone .file-selected {
    display: none;
    border: 2px solid #28a745;
    border-radius: 10px;
    background: #eafaf1;
    padding: 16px 20px;
    margin-top: 16px;
}

.packaging-import-zone .file-selected.show {
    display: block;
}

/* Import result cards */
.import-result-card {
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.import-result-card.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 5px solid #28a745;
}

.import-result-card.updated {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-left: 5px solid #ffc107;
}

.import-result-card.skipped {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 5px solid #dc3545;
}

.import-result-card.error {
    background: linear-gradient(135deg, #e2e3e5, #d6d8db);
    border-left: 5px solid #6c757d;
}

.import-result-card .stat-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.import-result-card .stat-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #495057;
}

/* Progress bar */
.import-progress-wrap {
    display: none;
    margin-top: 24px;
}

.import-progress-wrap.show {
    display: block;
}

.progress-bar-animated {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #005fa7, #00a8b0);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Preview table */
.preview-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    margin-bottom: 20px;
}

.preview-table-wrap table {
    margin-bottom: 0;
    font-size: 13px;
}

.preview-table-wrap thead th {
    position: sticky;
    top: 0;
    background: #00456c;
    color: #fff;
    z-index: 2;
    white-space: nowrap;
}

/* ---- List Page ---- */
.filter-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-card .form-control,
.filter-card .custom-select {
    border-radius: 8px;
    border: 1.5px solid #ced4da;
    transition: border-color 0.2s;
}

.filter-card .form-control:focus,
.filter-card .custom-select:focus {
    border-color: #005fa7;
    box-shadow: 0 0 0 3px rgba(0,95,167,0.1);
}

.stats-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-pill {
    background: linear-gradient(135deg, #005fa7, #0077cc);
    color: #fff;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-pill .count {
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    padding: 2px 10px;
    font-size: 16px;
}

/* Table enhancements */
.packaging-table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.packaging-table thead th {
    background: #00456c;
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 14px 12px;
}

.packaging-table tbody tr {
    transition: background 0.15s;
}

.packaging-table tbody tr:hover {
    background: #f0f7ff;
}

.packaging-table tbody td {
    vertical-align: middle;
    padding: 10px 12px;
    font-size: 13px;
    border-color: #e9ecef;
}

.item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.status-badge {
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.frozen {
    background: #fff3cd;
    color: #856404;
}

.category-tag {
    background: #e9ecef;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    color: #495057;
    display: inline-block;
    margin: 2px;
}

/* Pagination */
.pagination-custom {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-custom .page-item .page-link {
    border-radius: 8px;
    color: #005fa7;
    font-weight: 600;
    font-size: 13px;
    min-width: 36px;
    text-align: center;
}

.pagination-custom .page-item.active .page-link {
    background: #005fa7;
    border-color: #005fa7;
    color: #fff;
}

/* ---- View Page (H5) ---- */
.view-page {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.view-header {
    background: linear-gradient(135deg, #023a69 0%, #005fa7 50%, #0077cc 100%);
    color: #fff;
    padding: 40px 0 50px;
    position: relative;
    overflow: hidden;
}

.view-header::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: #f8f9fa;
    border-radius: 50% 50% 0 0;
}

.view-header .breadcrumb-custom {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.view-header .breadcrumb-custom a {
    color: rgba(255,255,255,0.7);
}

.view-header .breadcrumb-custom .separator {
    color: rgba(255,255,255,0.4);
    margin: 0 8px;
}

.view-header .item-title {
    font-size: 28px;
    font-weight: 800;
    margin: 20px 0 8px;
    color: #fff;
}

.view-header .item-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.view-header .item-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-header .item-thumb-lg {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

/* Style switcher */
.style-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.style-btn {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 10px 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.style-btn:hover {
    border-color: #005fa7;
    color: #005fa7;
}

.style-btn.active {
    background: #005fa7;
    border-color: #005fa7;
    color: #fff;
}

/* Content area */
.view-content {
    padding: 30px 0 60px;
}

/* Info cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.info-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    border-top: 4px solid #005fa7;
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.info-card .card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #868e96;
    margin-bottom: 6px;
}

.info-card .card-value {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.info-card.material {
    border-top-color: #e57825;
}

.info-card.status {
    border-top-color: #28a745;
}

/* BOM Section Title */
.section-title {
    font-size: 20px;
    font-weight: 800;
    color: #023a69;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, #dee2e6, transparent);
    border-radius: 1px;
}

/* Style 1: Card Grid */
.bom-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.bom-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.bom-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.bom-card-header {
    background: linear-gradient(135deg, #00456c, #005fa7);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bom-card-header .bom-id {
    font-size: 12px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    word-break: break-all;
    flex: 1;
}

.bom-card-header .qty-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    margin-left: 10px;
}

.bom-card-body {
    padding: 16px 20px;
    flex: 1;
}

.bom-card-body .bom-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
    font-size: 13px;
}

.bom-card-body .bom-detail:last-child {
    border-bottom: none;
}

.bom-card-body .bom-detail .label {
    color: #868e96;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.bom-card-body .bom-detail .value {
    font-weight: 700;
    color: #212529;
    text-align: right;
}

/* Style 2: Compact Table */
.bom-table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.bom-table {
    width: 100%;
    border-collapse: collapse;
}

.bom-table thead th {
    background: linear-gradient(135deg, #00456c, #005fa7);
    color: #fff;
    padding: 14px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.bom-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.15s;
}

.bom-table tbody tr:hover {
    background: #f8f9fa;
}

.bom-table tbody tr:last-child {
    border-bottom: none;
}

.bom-table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    vertical-align: middle;
}

.bom-table .bom-id-cell {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #005fa7;
    font-weight: 600;
    word-break: break-all;
    max-width: 200px;
}

.qty-chip {
    background: #e3f2fd;
    color: #005fa7;
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #868e96;
}

.empty-state .icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.empty-state h4 {
    font-weight: 700;
    color: #495057;
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .view-header {
        padding: 30px 0 40px;
    }

    .view-header .item-title {
        font-size: 22px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bom-card-grid {
        grid-template-columns: 1fr;
    }

    .style-switcher {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}
