/* inventory.css */
.category-header {
    font-size: 16px;
    font-weight: 900;
    color: var(--primary-blue);
    margin: 32px 0 16px 0;
    padding-left: 10px;
    border-left: 4px solid var(--primary-red);
    text-transform: uppercase;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.model-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-title i {
    color: var(--primary-red);
}

.model-count {
    font-size: 11px;
    color: var(--primary-blue);
    font-weight: 700;
}

.group-items {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: stretch;
    -ms-overflow-style: none; 
    scrollbar-width: none;
}
.group-items::-webkit-scrollbar { 
    display: none; 
}

.unit-card {
    min-width: 340px;
    width: 340px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

/* For mobile viewing, snap to width */
@media (max-width: 500px) {
    .unit-card {
        min-width: 300px;
        width: 85vw;
    }
}

.card-top {
    display: flex;
    gap: 16px;
    align-items: center;
}

.car-image {
    width: 80px;
    height: 60px;
    background: #f8fafc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.car-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.car-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.code-text {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
}
.code-text span {
    color: var(--primary-red);
    word-break: break-word;
}

.chassis-text {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}
.chassis-text span {
    font-weight: 800;
    color: var(--text-dark);
}

.pill-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.color-pill {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.status-pill {
    font-size: 9px;
    font-weight: 800;
    color: #15803d;
    background: #dcfce7;
    padding: 3px 8px;
    border-radius: 99px;
}

.qty-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qty-num {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-blue);
    line-height: 1;
}
.qty-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--primary-blue);
    margin-top: 2px;
}

.dashed-line {
    border-top: 1px dashed #cbd5e1;
    margin: 4px 0;
}

.tags-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.tag-pill {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tag-pill i {
    color: var(--primary-red);
}

.btn-ambil {
    background: #22c55e;
    color: white;
    font-weight: 800;
    font-size: 13px;
    padding: 10px;
    border-radius: 8px;
    border: none;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-ambil:hover {
    background: #16a34a;
}

/* Modal Filter Styles */
.filter-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.filter-overlay.active {
    display: flex;
}
.filter-content {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}
.close-filter {
    background: none; border: none; font-size: 18px; cursor: pointer; color: #64748b;
}
.filter-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--text-dark);
}
.filter-footer {
    display: flex;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
.filter-footer button {
    flex: 1;
}

/* Fix Search Bar Layout */
.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}
.search-bar .form-control {
    flex-grow: 1;
    margin-bottom: 0;
}

.btn-filter-square, .btn-refresh-square {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.2s ease;
}
.btn-filter-square i, .btn-refresh-square i {
    font-size: 16px;
}
.btn-filter-square {
    background: #f1f5f9;
    color: var(--primary-blue);
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.2);
}
.btn-refresh-square {
    background: #be123c;
    color: white;
    box-shadow: 0 4px 10px rgba(190, 18, 60, 0.3);
}
.btn-filter-square:hover, .btn-refresh-square:hover {
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════
   SPK / AMBIL UNIT MODAL
══════════════════════════════════════════════════ */
.spk-modal-content {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: spkModalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

.spk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.spk-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.spk-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spk-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.spk-modal-body {
    padding: 20px 24px 24px;
    max-height: 75vh;
    overflow-y: auto;
}

/* Unit Preview Card in Modal */
.spk-unit-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.spk-preview-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spk-preview-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.spk-preview-title {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

.spk-preview-divider {
    border-top: 1px dashed #cbd5e1;
    margin: 10px 0;
}

.spk-preview-chassis {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spk-chassis-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.spk-chassis-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.spk-chassis-label {
    font-size: 9px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spk-chassis-val {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.2px;
}

/* SPK Form Fields */
.spk-field-group {
    margin-bottom: 16px;
}

.spk-field-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.spk-field-label span {
    color: #ef4444;
}

.spk-input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.25s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.spk-input:focus {
    background: white;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    outline: none;
}

.spk-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.spk-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.btn-spk-cancel {
    background: white;
    border: 1.5px solid #e2e8f0;
    color: #334155;
    font-size: 13.5px;
    font-weight: 700;
    padding: 11px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.btn-spk-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-spk-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    font-size: 13.5px;
    font-weight: 800;
    padding: 11px 22px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    flex: 1;
}

.btn-spk-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.btn-spk-submit:active {
    transform: scale(0.98);
}
