/* ============================================================
   bodega.css  --  Styles for Nexus Autoparts Warehouse (Bodega)
   ============================================================ */

/* --- Layout --- */
.bodega-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 5.5rem 2rem 3rem;
}

/* --- Tabs --- */
.bodega-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.bodega-tab {
    padding: 0.8rem 1.8rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
    bottom: -2px;
}

.bodega-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.bodega-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.bodega-section {
    display: none;
}

.bodega-section.active {
    display: block;
}

/* --- Section Intro --- */
.section-intro {
    margin-bottom: 1.5rem;
}

.section-intro h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-intro p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- Mapping Form --- */
.mapping-form {
    max-width: 550px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.mapping-form .form-group {
    margin-bottom: 1.25rem;
}

.mapping-form .form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.required {
    color: var(--danger);
    font-weight: 700;
}

.optional {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.status-msg {
    font-size: 0.85rem;
    font-weight: 500;
}

.status-msg.success {
    color: var(--success);
}

.status-msg.error {
    color: var(--danger);
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-card);
    margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- Selected File --- */
.selected-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    line-height: 1;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--danger);
}

/* --- Upload Result --- */
.upload-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.upload-result h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.result-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.result-stat.ok {
    color: var(--success);
}

.result-stat.err {
    color: var(--danger);
}

.error-samples {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-height: 150px;
    overflow-y: auto;
}

.error-samples p {
    margin-bottom: 0.3rem;
}

/* --- History --- */
.history-section {
    margin-top: 2rem;
}

.history-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* --- Tables --- */
.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.empty-row {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem !important;
}

/* --- Status Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-error {
    background: rgba(255, 68, 68, 0.15);
    color: var(--danger);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

/* --- Inventory Toolbar --- */
.inventory-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
}

.search-box .form-input {
    flex: 1;
}

.btn-danger {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* --- Pagination --- */
.bodega-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.bodega-pagination button {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.bodega-pagination button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.bodega-pagination button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.bodega-pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* --- Confirm Modal --- */
.confirm-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
}

.confirm-box h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.confirm-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* --- Toast --- */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    max-width: 350px;
}

.toast.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.toast.error {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .bodega-container {
        padding: 5rem 1rem 2rem;
    }

    .bodega-tabs {
        overflow-x: auto;
    }

    .bodega-tab {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .inventory-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .result-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
