/* ==========================================================
   forms.css
   NOTE: This file must NOT redefine classes owned by layout.css
   (.erp-form-row, .erp-label, .erp-input/.erp-select/.erp-textarea,
   .master-card*, .btn-erp, .erp-form-actions). layout.css is the
   single source of truth for those. Only page-specific / additive
   rules belong here.
========================================================== */

/* =========================
   INDEX TOOLBAR / SEARCH
========================= */
.index-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.index-search {
    display: flex;
    gap: 10px;
    align-items: center;
}

    .index-search input {
        min-width: auto;
    }

        .index-search input[type=date] {
            width: 140px;
        }

        .index-search input[type=text] {
            width: 300px;
        }

    .index-search select {
        width: 250px;
    }

.index-pagesize {
    width: 100px;
}

/* =========================
   ERP FORM (page-specific extras only)
========================= */
.erp-form {
    width: 100%;
    max-width: 1200px;
}

.erp-row-group {
    display: flex;
    gap: 5px;
    flex: 1;
}

@media (max-width:768px) {
    .erp-row-group {
        flex-direction: column;
    }
}

/* =========================
   MASTER DUPLICATE CHECK – Similar-Record Dropdown
   ========================= */
.erp-input-wrap {
    position: relative;
    display: block;
}

.mcs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    font-size: .85rem;
}

.mcs-header {
    padding: 6px 12px;
    font-size: .78rem;
    color: #667085;
    background: #f9fafb;
    border-bottom: 1px solid #eaecf0;
}

.mcs-item {
    padding: 7px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f2f4f7;
}

.mcs-item:last-child { border-bottom: none; }
.mcs-item:hover { background: #f0f5ff; }
.mcs-item.mcs-exact { background: #fff8e1; font-weight: 600; }
.mcs-item.mcs-exact:hover { background: #ffecb3; }

.mcs-text { flex: 1; }

.mcs-badge {
    font-size: .7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f59e0b;
    color: #fff;
    white-space: nowrap;
    font-weight: 500;
}
