/* assets/css/style.css - Version 1.0.2 */

/* Base Styles */
.mauk-members-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.mauk-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.mauk-header h1 {
    margin: 0;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
}

.role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Tabs */
.mauk-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-link {
    background: none;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.tab-link:hover {
    background: #f3f4f6;
    color: #374151;
}

.tab-link.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.tab-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-link:disabled:hover {
    background: none;
    color: #6b7280;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #667eea, #764ba2);
}

.card-icon {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 15px;
}

.card-title {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
}

.card-change {
    font-size: 14px;
    color: #059669;
}

.card-change.negative {
    color: #dc2626;
}

/* Dashboard List View */
.dashboard-list {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dashboard-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-search-box {
    display: flex;
    gap: 10px;
    max-width: 300px;
    width: 100%;
}

.dashboard-search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.dashboard-search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.dashboard-search-box button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dashboard-search-box button:hover {
    background: #5a67d8;
}

.back-to-dashboard {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
}

.back-to-dashboard:hover {
    background: #4b5563;
}

.dashboard-pagination-info {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: right;
}

.dashboard-table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.dashboard-table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.dashboard-table-container th {
    background: #f9fafb;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.dashboard-table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    white-space: nowrap;
}

.dashboard-table-container tbody tr:hover {
    background: #f9fafb;
}

.dashboard-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.dashboard-pagination-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.dashboard-pagination-controls button:hover:not(:disabled) {
    background: #5a67d8;
}

.dashboard-pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#dashboard-page-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dashboard-page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.dashboard-page-number:hover {
    background: #f3f4f6;
}

.dashboard-page-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Members Table */
.members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 400px;
    width: 100%;
    min-width: 250px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    min-width: 200px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 20px;
    cursor: pointer;
    transition: background 0.3s ease;
    min-width: 60px;
}

.search-box button:hover {
    background: #5a67d8;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
    white-space: nowrap;
}

/* Table Container - Fixed for mobile */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e5e7eb;
}

#members-table, #renewals-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

#members-table thead, #renewals-table thead {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
}

#members-table th, #renewals-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
    border-right: 1px solid #e5e7eb;
}

#members-table th:last-child, #renewals-table th:last-child {
    border-right: none;
}

#members-table th:hover {
    background: #f3f4f6;
}

#members-table th i {
    margin-left: 5px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#members-table th:hover i {
    opacity: 1;
}

#members-table th.sorted-asc i.fa-sort-up,
#members-table th.sorted-desc i.fa-sort-down {
    opacity: 1;
}

#members-table td, #renewals-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
    white-space: nowrap;
    border-right: 1px solid #f3f4f6;
}

#members-table td:last-child, #renewals-table td:last-child {
    border-right: none;
}

#members-table tbody tr, #renewals-table tbody tr {
    transition: background 0.2s ease;
}

#members-table tbody tr:hover, #renewals-table tbody tr:hover {
    background: #f9fafb;
}

#members-table tbody tr:last-child td, #renewals-table tbody tr:last-child td {
    border-bottom: none;
}

/* Added: Horizontal line between rows */
#members-table tbody tr td, #renewals-table tbody tr td {
    border-bottom: 1px solid #e5e7eb;
}

.clickable {
    color: #667eea;
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s ease;
}

.clickable:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Pagination */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.pagination-controls button:hover:not(:disabled) {
    background: #5a67d8;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-width: 40px;
}

.page-number:hover {
    background: #f3f4f6;
}

.page-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.form-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.form-section h3 {
    margin: 0 0 20px 0;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.form-row {
    display: grid;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
    font-size: 14px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 30px auto;
    width: 95%;
    max-width: 1200px;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: #374151;
    font-size: 20px;
}

.close-modal {
    font-size: 24px;
    color: #edeef1;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-modal:hover {
    color: #d7e3f7;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 70vh;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Member Details Cards Layout */
.member-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.member-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-icon {
    color: #667eea;
    font-size: 18px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-row {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px dashed #f3f4f6;
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.card-value {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    word-break: break-word;
}

.card-value.amount {
    color: #059669;
    font-weight: 600;
}

.card-value.status-active {
    color: #065f46;
    background: #d1fae5;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
}

.card-value.status-inactive {
    color: #374151;
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
}

.card-value.status-expired {
    color: #991b1b;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
}

.card-value.status-underpaid {
    color: #92400e;
    background: #fef3c7;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
}

.card-value.status-deceased {
    color: white;
    background: #1f2937;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
}

.card-value.yes {
    color: #065f46;
    font-weight: 600;
}

.card-value.no {
    color: #991b1b;
    font-weight: 600;
}

/* Old Member Details (keep for backward compatibility) */
.member-details-grid {
    display: grid;
    gap: 15px;
}

.detail-group {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.detail-group:last-child {
    border-bottom: none;
}

.detail-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-group .value {
    font-size: 14px;
    color: #4b5563;
    padding: 6px 0;
    word-break: break-word;
}

/* Renewals */
.renewals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.report-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-btn {
    background: #e5e7eb;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.report-btn:hover {
    background: #d1d5db;
}

.report-btn.active {
    background: #667eea;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 16px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-underpaid {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive {
    background: #e5e7eb;
    color: #374151;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.status-deceased {
    background: #1f2937;
    color: white;
}

/* Renewals pagination */
.renewals-pagination-info {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: right;
}

.renewals-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.renewals-pagination-controls button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.renewals-pagination-controls button:hover:not(:disabled) {
    background: #5a67d8;
}

.renewals-pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#renewals-page-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.renewals-page-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.renewals-page-number:hover {
    background: #f3f4f6;
}

.renewals-page-number.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive Design */
/* Mobile (portrait) */
@media (max-width: 767px) {
    .mauk-members-container {
        padding: 10px !important;
        margin: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .mauk-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .mauk-header h1 {
        font-size: 20px;
        justify-content: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .mauk-tabs {
        margin-bottom: 15px;
        padding-bottom: 5px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-link {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .dashboard-list-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dashboard-search-box {
        max-width: 100%;
    }
    
    .table-container {
        margin: 0 -10px;
        width: calc(100% + 20px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .renewals-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-selector {
        flex-direction: column;
    }
    
    .report-btn {
        text-align: center;
    }
    
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        max-height: 90vh !important;
    }
    
    .member-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Make some form sections full width on desktop */
    .form-section:nth-child(3),
    .form-section:nth-child(4) {
        grid-column: span 2;
    }
}

/* Desktop only */
@media (min-width: 1024px) {
    .form-grid {
        gap: 25px;
    }
    
    .form-section {
        min-height: 280px;
    }
}

/* Fix for date pickers on mobile */
input.datepicker[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Access denied message */
.mauk-access-denied {
    text-align: center;
    padding: 40px 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin: 20px;
}
/* Enhanced Member Details Cards Layout */
.member-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.member-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    color: #667eea;
    font-size: 18px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-row {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.card-row:last-child {
    border-bottom: none;
}

.card-row.inline-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: start;
}

.card-row.inline-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    align-items: start;
}

.card-row.inline-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.card-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-value {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.4;
}

.card-value.amount {
    color: #059669;
    font-weight: 600;
}

.card-value.status-active {
    color: #065f46;
    background: #d1fae5;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.card-value.status-inactive {
    color: #374151;
    background: #e5e7eb;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.card-value.status-expired {
    color: #991b1b;
    background: #fee2e2;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.card-value.status-underpaid {
    color: #92400e;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.card-value.status-deceased {
    color: white;
    background: #1f2937;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
}

.card-value.yes {
    color: #065f46;
    font-weight: 600;
}

.card-value.no {
    color: #991b1b;
    font-weight: 600;
}

.card-value.emphasized {
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
}

/* Responsive adjustments for cards */
@media (max-width: 768px) {
    .member-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .card-row.inline-2,
    .card-row.inline-3,
    .card-row.inline-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modal-content {
        margin: 10px !important;
        width: calc(100% - 20px) !important;
    }
}

/* Scrollable modal body */
.modal-body {
    max-height: 75vh;
    overflow-y: auto;
}

/* Ensure modal is wide enough for cards */
.modal-content {
    max-width: 1300px !important;
}

/* Status badges for table view */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-underpaid {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive {
    background: #e5e7eb;
    color: #374151;
}

.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.status-deceased {
    background: #1f2937;
    color: white;
}
/* Enhanced Edit Form Styles */
#member-edit-form .member-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

#member-edit-form .form-group {
    margin-bottom: 15px;
}

#member-edit-form .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#member-edit-form .form-control:focus {
    outline: none;
    border-color: #667eea;
}

#member-edit-form select.form-control {
    padding: 8px 12px;
    height: 38px;
}

#member-edit-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
}

#member-edit-form .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

#member-edit-form .form-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

/* Read-only fields in edit form */
#member-edit-form .card-value {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
    padding: 8px 0;
}

/* Make modal wider for edit form */
.modal-content {
    max-width: 1400px !important;
}

/* Enhanced label styles for concise layout */
.card-label.uppercase {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
    font-weight: 700;
}

/* Make card content more compact */
.card-content.compact {
    gap: 8px;
}

/* Single line values */
.card-value.single-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Name display as single line */
.name-display {
    display: flex;
    gap: 4px;
    align-items: center;
}

.name-display .card-value {
    margin-right: 8px;
}

/* Address display */
.address-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Form controls in card layout */
#member-edit-form .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

#member-edit-form select.form-control {
    height: 34px;
}

#member-edit-form .card-label {
    margin-bottom: 2px;
}

/* Payment date note */
.payment-date-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #0369a1;
}

.payment-date-note i {
    margin-right: 4px;
}

/* Auto-calculated fields */
.auto-calculated {
    background: #f8fafc;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Days Remaining/Overdue styling - Fixed for gridlines */
.days-critical {
    color: #ef4444 !important;
    font-weight: 700;
}

.days-warning {
    color: #f59e0b !important;
    font-weight: 600;
}

.days-caution {
    color: #f59e0b !important;
    font-weight: 500;
}

.days-normal {
    color: #10b981 !important;
    font-weight: 500;
}

.days-overdue-recent {
    color: #f59e0b !important;
    font-weight: 600;
}

.days-overdue-medium {
    color: #ef4444 !important;
    font-weight: 600;
}

.days-overdue-long {
    color: #991b1b !important;
    font-weight: 700;
}

/* Make the days columns cells maintain gridlines */
#renewals-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #f3f4f6;
    vertical-align: middle;
    position: relative;
}

/* Remove the inline-block display from table cells */
#renewals-table td .clickable,
#renewals-table td span,
#renewals-table td div {
    display: inline;
}

/* Ensure the entire cell maintains proper alignment */
#renewals-table td:first-child {
    padding-left: 15px;
}

/* Make the days column headers stand out without breaking gridlines */
#renewals-table th:nth-child(2) {
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
    position: relative;
}

#renewals-table th:nth-child(2)::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 25%;
    bottom: 25%;
    width: 1px;
    background: #d1d5db;
}

#renewals-table td:nth-child(2) {
    font-weight: 600;
    border-right: 1px solid #f3f4f6;
    position: relative;
}

/* Add subtle background highlight for urgent days */
#renewals-table td.days-critical,
#renewals-table td.days-overdue-long {
    background-color: rgba(254, 226, 226, 0.3);
}

#renewals-table td.days-warning,
#renewals-table td.days-overdue-medium {
    background-color: rgba(254, 243, 199, 0.3);
}

#renewals-table td.days-overdue-recent {
    background-color: rgba(254, 243, 199, 0.2);
}

/* Ensure table maintains consistent borders */
#renewals-table {
    border-collapse: collapse;
    border-spacing: 0;
}

#renewals-table thead th {
    border-bottom: 2px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
}

#renewals-table thead th:last-child {
    border-right: none;
}

#renewals-table tbody tr:last-child td {
    border-bottom: 1px solid #e5e7eb;
}

/* Keep the hover effect */
#renewals-table tbody tr:hover td {
    background-color: #f9fafb;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    #renewals-table td,
    #renewals-table th {
        padding: 10px 12px;
    }
    
    #renewals-table td:nth-child(2),
    #renewals-table th:nth-child(2) {
        min-width: 120px;
    }
}