/* ============================================================
   UNIVERSAL FILES HEADING (ADMIN + FRONTEND)
   ============================================================ */
.mfm-files-heading {
    display: block !important;
	font-size: 20px;
    line-height: 1.4;
    font-weight: 600;
    margin: 20px 0 10px;
}

/* ============================================================
   ACCORDION STYLING LAYOUT (ADMIN + FRONTEND)
   ============================================================ */
.mfm-accordion-item {
    padding: 8px 10px;
    background: #f1f1f1;
    cursor: pointer;
    margin-top: 4px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mfm-accordion-item .dashicons {
    transition: transform 0.2s ease;
}

.mfm-accordion-item.open .dashicons {
    transform: rotate(180deg);
}

.mfm-accordion-content {
    padding: 8px 16px;
    background: #fff;
    border-left: 2px solid #ddd;
}

.mfm-accordion-content {
    display: none;
}

.mfm-accordion-content.open {
    display: block;
}

/* Nested content must NOT collapse the parent */
.mfm-accordion-content .mfm-accordion-content {
    display: none;
}

.mfm-accordion-content .mfm-accordion-content.open {
    display: block;
}

/* ============================================================
   FILE LIST ROW LAYOUT (RESTORES ORIGINAL BEHAVIOR)
   ============================================================ */
.mfm-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 4px;
    border-bottom: 1px solid #ddd;
}

/* Filename expands left */
.mfm-file-name {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Version sits just before buttons */
.mfm-file-version {
    flex: 0 0 auto;
    margin-right: 10px;
    white-space: nowrap;
    color: #555;
    font-size: 13px;
}

/* Buttons aligned right */
.mfm-file-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
}

/* ============================================================
   UNIVERSAL MFM TABLE
   ============================================================ */
.mfm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
}

.mfm-table th,
.mfm-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.mfm-table th {
    width: 220px;
    text-align: left;
    font-weight: 600;
}

/* Light row striping */
.mfm-table tr:nth-child(even) {
    background: #f7f7f7;
}

/* ============================================================
   MISSING FIELD HIGHLIGHT
   ============================================================ */
.mfm-missing-field {
    background: #ffecec !important;
	border-left: 4px solid #d00;
}

.mfm-missing-field th label,
.mfm-missing-field td {
    color: #b30000;
    font-weight: 600;
}

/* ============================================================
   SELECT + INPUT FIELDS
   ============================================================ */
.mfm-table select,
.mfm-table input[type="text"] {
    width: 100%;
    max-width: 350px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    font-size: 14px;
}

.mfm-table select:focus,
.mfm-table input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
}

/* ============================================================
   FRONTEND BUTTON
   ============================================================ */
.mfm-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.mfm-btn:hover {
    background: #1a5a8a;
}

/* ============================================================
   FRONTEND WRAPPER
   ============================================================ */
.mfm-frontend {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
}

.mfm-category-select {
	margin-bottom: 20px;
}

.mfm-category-select {
    width: 250px;
}

/* ============================================================
   NOTICE BOXES (FRONTEND)
   ============================================================ */
.mfm-success {
    background: #e6f7e6;
    border-left: 4px solid #2e8b57;
    padding: 10px 12px;
    margin-bottom: 15px;
}

.mfm-error {
    background: #ffecec;
    border-left: 4px solid #cc0000;
    padding: 10px 12px;
    margin-bottom: 15px;
}

/* ============================================================
   ADMIN DIALOG WRAPPER
   ============================================================ */
.mfm-admin-dialog {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    margin-top: 20px;
}

.mfm-admin-dialog h2 {
    margin-top: 0;
}

/* ============================================================
   FILE INPUT
   ============================================================ */
.mfm-admin-dialog input[type="file"],
.mfm-frontend input[type="file"] {
    margin-top: 5px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
    .mfm-table th {
        width: auto;
        display: block;
        margin-bottom: 5px;
    }

    .mfm-table td {
        display: block;
        margin-bottom: 15px;
    }
}
/* ============================================================
   REQUIRED FIELD INDICATOR
   ============================================================ */
.mfm-required-asterisk {
    color: #d00;
    font-weight: bold;
    margin-left: 4px;
}

.mfm-required-row th label::after {
    content: " *";
    color: #d00;
    font-weight: bold;
}
/* ============================================================
   REQUIRED FIELD INDICATOR
   ============================================================ */
.mfm-required-asterisk {
    color: #d00;
    font-weight: bold;
    margin-left: 4px;
}

.mfm-required-row th label::after {
    content: " *";
    color: #d00;
    font-weight: bold;
}

.mfm-section-header {
    background: #f0f0f0;
}

.mfm-system-row {
    background: #fafafa;
}

/* ==========================================
   Field Alignment of search form
   ========================================== */
   /* Force admin inputs to obey flex layout */
.mfm-row .mfm-col input[type="text"],
.mfm-row .mfm-col select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Make all columns equal height and width */
.mfm-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    align-items: stretch; /* <-- key */
}

.mfm-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mfm-form-wrapper {
    width: 75%;
    min-width: 500px; /* optional, prevents it from getting too narrow */
    margin: 40px;   /* center it */
}

.mfm-col input[type="text"],
.mfm-col select {
    width: 100%!important;
}

/* Make Member Number + Member Name row match Document Type height */
.mfm-row-top .mfm-col {
    display: flex;
    flex-direction: column;
}

.mfm-row-top .mfm-col input[type="text"] {
    height: 45px; /* matches WP admin input height */
}

/* =====================================
   Search result table layout
   ===================================== */
/* Admin File Search – Column Width Adjustments */
.mfm-admin-search .wp-list-table th:nth-child(1),
.mfm-admin-search .wp-list-table td:nth-child(1) {
    width: 50%; /* Filename */
}

.mfm-admin-search .wp-list-table th:nth-child(2),
.mfm-admin-search .wp-list-table td:nth-child(2) {
    width: 10%; /* Category */
    white-space: nowrap;
    text-align: right;
}

.mfm-admin-search .wp-list-table th:nth-child(3),
.mfm-admin-search .wp-list-table td:nth-child(3) {
    width: 20%; /* Type */
    white-space: nowrap;
}

.mfm-admin-search .wp-list-table th:nth-child(4),
.mfm-admin-search .wp-list-table td:nth-child(4) {
    width: 20%; /* Actions */
    white-space: nowrap;
}

/* =====================================
   Search member page pagination
   ===================================== */
.tablenav {
    clear: both;
    height: 30px;
    margin: 8px 0 8px;
}

.tablenav .tablenav-pages {
    float: right;
    margin: 2px 0;
    line-height: 28px;
}

.tablenav .displaying-num {
    margin-right: 10px;
}

.tablenav .pagination-links a,
.tablenav .pagination-links span {
    display: inline-block;
    min-width: 26px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    margin: 0 2px;
    padding: 0 4px;
    border: 1px solid #c3c4c7;
    background: #fff;
    text-decoration: none;
    border-radius: 3px;
}

.tablenav .pagination-links .current {
    background: #f0f0f1;
    font-weight: 600;
}

.tablenav .pagination-links a:hover {
    background: #f6f7f7;
}

