/* ========================================
   GENERATEPRESS CHILD - MANAGE ENTRIES CSS
   Complete Responsive Solution
======================================== */

/* Fix for GeneratePress theme - Force full width */
.fms-page-content,
.site-content .fms-page-content,
.inside-site-content .fms-page-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
}

/* Main Wrapper */
.fms-manage-wrap {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #f8fafc;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.fms-manage-wrap h2 {
    font-size: 28px;
    margin: 0 0 20px 0;
    color: #1e293b;
    font-weight: 700;
}

/* ========================================
   FILTER SECTION - Responsive
======================================== */

.fms-manage-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.fms-manage-filters select,
.fms-manage-filters input[type="text"] {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    min-width: 150px;
    color: #334155;
    transition: all 0.2s;
}

.fms-manage-filters select:focus,
.fms-manage-filters input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

/* ========================================
   BUTTONS
======================================== */

.fms-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.fms-btn-filter {
    background: #3b82f6;
    color: #ffffff;
}

.fms-btn-filter:hover {
    background: #2563eb;
}

.fms-btn-reset {
    background: #e2e8f0;
    color: #475569;
}

.fms-btn-reset:hover {
    background: #cbd5e1;
}

.fms-btn-update {
    background: #3b82f6;
    color: #ffffff;
}

.fms-btn-cancel {
    background: #e2e8f0;
    color: #475569;
}

/* ========================================
   ALERT MESSAGES
======================================== */

.fms-alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
}

.fms-alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.fms-alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.fms-alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* ========================================
   EDIT FORM
======================================== */

.fms-edit-form-wrap {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fms-edit-form-wrap h3 {
    font-size: 20px;
    color: #1e293b;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

.fms-edit-form-wrap .fms-form-group {
    margin-bottom: 18px;
}

.fms-edit-form-wrap .fms-form-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    font-size: 13px;
}

.fms-edit-form-wrap .fms-form-group select,
.fms-edit-form-wrap .fms-form-group input,
.fms-edit-form-wrap .fms-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background: #f8fafc;
    box-sizing: border-box;
}

.fms-edit-form-wrap .fms-form-group select:focus,
.fms-edit-form-wrap .fms-form-group input:focus,
.fms-edit-form-wrap .fms-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
}

.fms-current-attachment {
    background: #f1f5f9;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.fms-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    margin-top: 10px;
}

.fms-file-remove {
    background: #fee2e2;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 11px;
    color: #dc2626;
    margin-left: auto;
}

/* ========================================
   TABLE - Responsive
======================================== */

.fms-manage-table-wrap {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 0;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
}

.fms-manage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 700px;
}

.fms-manage-table th {
    background: #f8fafc;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.fms-manage-table td {
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.fms-manage-table tbody tr:hover {
    background: #f8fafc;
}

/* Amount Cell */
.fms-manage-table .amount-cell {
    text-align: right;
    font-weight: 600;
}

/* Type Colors */
.fms-type-receive {
    color: #16a34a;
    font-weight: 600;
}

.fms-type-expense {
    color: #dc2626;
    font-weight: 600;
}

/* Action Buttons */
.fms-action-edit {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    margin-right: 12px;
}

.fms-action-delete {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
}

/* Attachment Link */
.fms-attachment-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    background: #eff6ff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fms-attachment-link:hover {
    background: #dbeafe;
}

.fms-no-attachment {
    color: #94a3b8;
    font-style: italic;
}

/* Remarks Cell */
.remarks-cell {
    max-width: 150px;
    word-wrap: break-word;
    white-space: normal;
}

/* No Remarks */
.fms-no-remarks {
    color: #94a3b8;
    font-style: italic;
}

/* ========================================
   PAGINATION
======================================== */

.fms-manage-pagination {
    margin-top: 20px;
    text-align: center;
}

.fms-manage-pagination a,
.fms-manage-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    background: #e2e8f0;
    color: #475569;
    min-width: 32px;
}

.fms-manage-pagination a:hover {
    background: #cbd5e1;
}

.fms-manage-pagination .current {
    background: #3b82f6;
    color: #ffffff;
}

/* ========================================
   RESPONSIVE - MOBILE (max-width: 768px)
======================================== */

@media screen and (max-width: 768px) {
    .fms-manage-wrap {
        padding: 12px;
    }
    
    .fms-manage-wrap h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    /* Filter Section - Stack Vertically */
    .fms-manage-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 10px;
    }
    
    .fms-manage-filters select,
    .fms-manage-filters input[type="text"] {
        width: 100%;
        min-width: auto;
    }
    
    .fms-btn-filter,
    .fms-btn-reset {
        width: 100%;
        justify-content: center;
    }
    
    /* Edit Form */
    .fms-edit-form-wrap {
        padding: 15px;
    }
    
    .fms-edit-form-wrap h3 {
        font-size: 18px;
    }
    
    .fms-current-attachment {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .fms-file-remove {
        margin-left: 0;
    }
    
    /* Table */
    .fms-manage-table-wrap {
        border-radius: 10px;
    }
    
    .fms-manage-table {
        min-width: 650px;
    }
    
    .fms-manage-table th,
    .fms-manage-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .remarks-cell {
        max-width: 100px;
    }
    
    .fms-action-edit,
    .fms-action-delete {
        font-size: 11px;
        margin-right: 8px;
    }
    
    .fms-attachment-link {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    /* Pagination */
    .fms-manage-pagination a,
    .fms-manage-pagination span {
        padding: 4px 10px;
        font-size: 11px;
        min-width: 28px;
    }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
======================================== */

@media screen and (max-width: 480px) {
    .fms-manage-wrap {
        padding: 8px;
    }
    
    .fms-manage-wrap h2 {
        font-size: 18px;
    }
    
    .fms-manage-filters {
        padding: 10px;
        gap: 8px;
    }
    
    .fms-manage-filters select,
    .fms-manage-filters input[type="text"] {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .fms-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .fms-edit-form-wrap {
        padding: 12px;
    }
    
    .fms-edit-form-wrap .fms-form-group select,
    .fms-edit-form-wrap .fms-form-group input,
    .fms-edit-form-wrap .fms-form-group textarea {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .fms-manage-table {
        min-width: 550px;
    }
    
    .fms-manage-table th,
    .fms-manage-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .remarks-cell {
        max-width: 80px;
    }
    
    .fms-action-edit,
    .fms-action-delete {
        font-size: 10px;
        margin-right: 6px;
    }
    
    .fms-attachment-link {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .fms-manage-pagination a,
    .fms-manage-pagination span {
        padding: 3px 8px;
        font-size: 10px;
        min-width: 24px;
    }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .fms-manage-filters,
    .fms-edit-overlay,
    .fms-edit-panel {
        display: none !important;
    }
    
    .fms-manage-table-wrap {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .fms-attachment-link {
        color: #000 !important;
        background: none !important;
    }
}