@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #26C165;
    --background-color: #F7F8FA;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #1C274C;
    --text-secondary: #858D99;
    --border-color: #E4E8EE;
    --positive-change: #00B69B;
    --negative-change: #F93C65;
    --card-shadow: 0px 10px 30px rgba(225, 229, 238, 0.5);

    /* Auth */
    --auth-card-shadow: 0px 20px 50px rgba(28, 39, 76, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

.container {
    display: flex;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 92px;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 92px;
}

.sidebar.collapsed .sidebar-header {
    padding: 24px 16px;
}

.sidebar.collapsed .sidebar-nav {
    padding: 16px;
    padding-top: 16px;
}

.sidebar.collapsed .sidebar-footer {
    padding: 16px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .menu-title,
.sidebar.collapsed .badge {
    opacity: 0;
    visibility: hidden;
    width: 0;
    transition: opacity 0.1s;
}

.sidebar.collapsed .toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 16px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), #1ea85b);
    border-radius: 12px;
    box-shadow: 0px 4px 15px rgba(38, 193, 101, 0.3);
    margin-bottom: 8px;
    width: calc(100% - 0px);
    justify-content: center;
}

.logo img {
    width: 32px;
}

.logo span {
    font-size: 16px;
    font-weight: 800;
    color: white;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    display: none;
}

.toggle-btn {
    background: #F0F2F5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-btn i {
    transition: transform 0.3s;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-top: 16px;
    scroll-behavior: smooth;
    overflow-anchor: auto;
}

/* Scrollbar for sidebar navigation */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.sidebar-nav .menu-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 24px 0 12px;
    padding: 0 12px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 15px;
}

.sidebar-nav li a.active,
.sidebar-nav li a:hover {
    background-color: #F0FBF4;
    color: var(--primary-color);
}

.sidebar-nav li a i {
    font-size: 16px;
    width: 24px;
    margin-right: 14px;
    text-align: center;
}

/* Submenu Styles */
.has-submenu .submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: transparent;
    border-radius: 8px;
    margin: 8px 0 0 0;
}

.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 20px 10px 40px !important;
    font-size: 14px;
    color: var(--text-secondary) !important;
    border-radius: 6px;
    margin: 4px 8px;
    background: transparent !important;
    text-decoration: none !important;
    width: auto !important;
}

/* Submenu icons */
.submenu a i {
    width: 20px;
    margin-right: 10px;
    font-size: 13px;
    text-align: center;
}

.submenu a:hover {
    background: #F0FBF4 !important;
    color: var(--primary-color) !important;
}

.submenu a.active {
    background: #F0FBF4 !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.badge {
    margin-left: auto;
    background: #F0F2F5;
    color: var(--text-primary);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}

.active .badge {
    background-color: #D3F3E0;
    color: var(--primary-color);
}

/* --- Auth (Login) --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(1200px 600px at 10% 10%, rgba(38, 193, 101, 0.12), transparent 55%),
        radial-gradient(900px 500px at 90% 20%, rgba(54, 159, 255, 0.10), transparent 50%),
        var(--background-color);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(228, 232, 238, 0.7);
    border-radius: 16px;
    box-shadow: var(--auth-card-shadow);
    padding: 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

/* If an auth logo is reintroduced later, keep spacing consistent */
.auth-logo {
    display: none;
}

/* removed auth-logo block (icon removed from login) */

.auth-brand h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-input {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 10px;
    padding: 12px 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus-within {
    border-color: rgba(38, 193, 101, 0.7);
    box-shadow: 0 0 0 4px rgba(38, 193, 101, 0.12);
}

.auth-input i {
    color: var(--text-secondary);
    width: 18px;
    text-align: center;
}

.auth-input input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
}

/* Prevent global .form-group input styles from adding a second border on login */
.auth-form .form-group input,
.auth-form .form-group input:focus {
    border: none !important;
    box-shadow: none !important;
}

.auth-toggle {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
}

.auth-toggle:hover {
    background: rgba(228, 232, 238, 0.5);
    color: var(--text-primary);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 0 18px 0;
}

.auth-row.auth-row-single {
    justify-content: flex-start;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.auth-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: var(--primary-color);
    color: white;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-submit:hover {
    background: #1ea051;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(38, 193, 101, 0.25);
}

.auth-messages {
    margin-bottom: 16px;
}

.auth-message {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border-left: 4px solid;
    background: #f8f9fa;
}

.auth-message.success {
    color: var(--positive-change);
    border-left-color: var(--positive-change);
    background: #f0fff4;
}

.auth-message.error {
    color: var(--negative-change);
    border-left-color: var(--negative-change);
    background: #fff5f5;
}

.auth-message.info {
    color: #0066cc;
    border-left-color: #0066cc;
    background: #f0f8ff;
}

.auth-message.warning {
    color: #ff9800;
    border-left-color: #ff9800;
    background: #fff8f0;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .auth-page {
        padding: 16px;
    }

    .auth-card {
        padding: 20px;
        border-radius: 14px;
    }

    .auth-brand h1 {
        font-size: 20px;
    }
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px 24px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
}

.sidebar-footer a:hover {
    background: #F0FBF4;
    color: var(--primary-color);
}

.sidebar-footer a i {
    width: 24px;
    text-align: center;
    font-size: 16px;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    height: 100vh;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-bottom: 1px solid rgba(228, 232, 238, 0.3);
    border-radius: 0;
    padding: 16px 24px;
    min-height: 60px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.header-left .welcome-title {
    font-size: 24px;
    font-weight: 700;
}

.header-left .welcome-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-box input {
    border: none;
    outline: none;
    margin-left: 8px;
    background: transparent;
}

.header-icons {
    display: flex;
    gap: 16px;
    font-size: 20px;
    color: var(--text-secondary);
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.export-btn {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-header {
    justify-content: flex-end;
}

/* Cards Header with Filter */
.cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 10px;
}

.cards-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.filter-dropdown {
    position: relative;
}

.filter-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

.filter-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0px 2px 8px rgba(38, 193, 101, 0.15);
}

.filter-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0px 0px 0px 3px rgba(38, 193, 101, 0.1);
}

/* --- Widgets & Cards --- */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 0 24px;
    align-items: stretch;
}

.card {
    background: var(--card-bg);
    padding: 18px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    width: 100%;
    min-height: 120px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

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

.card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F0F2F5;
    color: var(--text-primary);
}

.account-balance .card-icon {
    background: #E6F9EF;
    color: var(--primary-color);
}

.currency-selector {
    background: #F0F2F5;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card h2 {
    font-size: 26px;
    margin-bottom: 6px;
}

.card .change {
    font-size: 13px;
}

.change.positive {
    color: var(--positive-change);
}

.change.negative {
    color: var(--negative-change);
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.action-buttons button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-buttons .send-money {
    background: var(--primary-color);
    color: #fff;
}

.action-buttons .request-money {
    background: #F0F2F5;
    color: var(--text-primary);
    border-color: var(--border-color);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.widget-header h3 {
    font-size: 18px;
}

/* Filter Button */
.filter-btn {
    background: rgba(76, 123, 243, 0.1);
    border: 1px solid rgba(76, 123, 243, 0.2);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(76, 123, 243, 0.15);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Three Column Section */
.three-column-section {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 24px;
    margin: 0 24px 24px 24px;
}

.column-left,
.column-center,
.column-right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.quick-actions,
.due-payments,
.collection-summary {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Due Payments Section */
.due-payments {
    padding: 18px 18px 0 18px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    border: 1px solid rgba(228, 232, 238, 0.3);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.due-payments .table-container {
    flex: 1;
    padding-bottom: 16px;
}

.due-payments .pagination {
    margin-top: auto;
    padding: 16px 0;
    flex-shrink: 0;
}

.due-payments .widget-header {
    margin-bottom: 20px;
    align-items: center;
}

.due-payments .widget-header h3 {
    color: #dc2626;
    font-weight: 800;
    font-size: 16px;
}

.urgent-badge {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

.due-payments table {
    width: 100%;
    border-collapse: collapse;
}

.due-payments th,
.due-payments td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    white-space: nowrap;
    line-height: 1.3;
}

.due-payments th {
    color: #6B7280;
    font-weight: 600;
}

.due-payments td {
    font-weight: 500;
}

.due-payments tr:last-child td {
    border-bottom: none;
}

.due-payments th:first-child,
.due-payments td:first-child {
    font-weight: 600;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.mark-paid {
    background: #22c55e;
    color: white;
}

.mark-paid:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

.send-alert {
    background: #f59e0b;
    color: white;
}

.send-alert:hover {
    background: #d97706;
    transform: translateY(-1px);
}

/* Collection Summary Analytics */
.collection-summary {
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    border: 1px solid rgba(228, 232, 238, 0.3);
    margin: 0;
}

.collection-summary .widget-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 20px;
}

.analytics-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.summary-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-label {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar.collected {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.progress-bar.pending {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 80px;
}

.progress-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Quick Action Buttons */
.quick-actions {
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    border: 1px solid rgba(228, 232, 238, 0.3);
    margin: 0;
}

.quick-actions .widget-header {
    margin-bottom: 40px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.quick-actions .widget-header h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    flex: 1;
    align-content: start;
    margin-bottom: 8px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    width: 100%;
    text-align: left;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0px 6px 20px rgba(38, 193, 101, 0.3);
}

.quick-action-btn .btn-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.quick-action-btn .btn-text {
    font-size: 14px;
    font-weight: 500;
}

.quick-action-btn:hover .btn-text {
    color: white;
}

/* Fix for Quick Action Send Alert button specificity */
.quick-actions .quick-action-btn.send-alert .btn-text {
    display: block;
    color: var(--text-primary);
}

.quick-actions .quick-action-btn.send-alert .btn-icon {
    display: block;
    color: var(--text-primary);
    opacity: 1;
    visibility: visible;
}

.quick-actions .quick-action-btn.send-alert:hover .btn-text {
    color: white;
}

.quick-actions .quick-action-btn.send-alert:hover .btn-icon {
    color: white;
}


/* Responsive Table */
.table-container {
    overflow-x: auto;
}

.recent-transactions {
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 0 24px 24px 24px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    border: 1px solid rgba(228, 232, 238, 0.3);
}

.recent-transactions table {
    width: 100%;
    border-collapse: collapse;
}

.recent-transactions th,
.recent-transactions td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    white-space: nowrap;
}

.recent-transactions th:first-child,
.recent-transactions td:first-child {
    font-weight: 600;
}

.recent-transactions th {
    color: var(--text-secondary);
    font-weight: 600;
}

.recent-transactions td {
    font-weight: 500;
}

.recent-transactions tr:last-child td {
    border-bottom: none;
}

.activity-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    flex-shrink: 0;
}

.activity-icon.blue {
    background-color: #369FFF;
}

.activity-icon.orange {
    background-color: #FF7F5C;
}

.activity-icon.green {
    background-color: #00B69B;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 12px;
}

.status-badge.success {
    background-color: #E6F9EF;
    color: var(--positive-change);
}

.action-cell {
    text-align: center !important;
}

/* Edit button styling for system settings */
.btn-edit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.btn-edit:hover {
    background: #1ea051;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(38, 193, 101, 0.3);
}

.btn-edit i {
    font-size: 14px;
}

/* Due Payments: Use existing button classes with small sizing */
.due-payments .btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    min-height: auto;
}

.due-payments .btn-primary {
    font-size: 11px;
    padding: 4px 8px;
}

.due-payments .btn-info {
    background: #369FFF;
    border-color: #369FFF;
    font-size: 11px;
    padding: 4px 8px;
}

.due-payments .btn-info:hover {
    background: #2977cc;
    border-color: #2977cc;
}

/* Modal form styling */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.modal-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.modal-actions .btn-primary:hover {
    background: #1ea051;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

.modal-actions .btn-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-actions .btn-cancel:hover {
    background: var(--background-color);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Mobile responsive for modal actions */
@media (max-width: 768px) {
    .modal-actions {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 16px;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-cancel {
        width: 100%;
        max-width: 200px;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-actions {
        gap: 12px;
        padding-top: 20px;
        margin-top: 20px;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-cancel {
        width: 100%;
        max-width: none;
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Payments table: center the Action column (header + three dots) */
.payments-table th:last-child,
.payments-table td.action-cell {
    text-align: center !important;
}

.payments-table td.action-cell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.payments-table td.action-cell .dropdown {
    display: inline-flex;
    justify-content: center;
}


/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.pagination-numbers {
    display: flex;
    gap: 4px;
    margin: 0 8px;
}

.pagination-number {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
}

.pagination-number:hover,
.pagination-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.hidden-row {
    display: none;
}

/* Groups Page Styles */
.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.groups-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.add-group-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.add-group-btn:hover {
    background: #1ea85b;
    transform: translateY(-1px);
    box-shadow: 0px 4px 12px rgba(38, 193, 101, 0.3);
}

.groups-table {
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 0 24px 24px 24px;
    box-shadow: 0px 4px 20px rgba(28, 39, 76, 0.05);
    border: 1px solid rgba(228, 232, 238, 0.3);
}

.groups-table table {
    width: 100%;
    border-collapse: collapse;
}

.groups-table th,
.groups-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    white-space: nowrap;
}

.groups-table th:first-child,
.groups-table td:first-child {
    font-weight: 600;
}

.groups-table th {
    color: #6B7280;
    font-weight: 600;
    background: rgba(248, 250, 252, 0.8);
}

.groups-table td {
    font-weight: 500;
}

.groups-table tr:last-child td {
    border-bottom: none;
}

.groups-table tr:hover {
    background: rgba(248, 250, 252, 0.5);
}

.status-badge.active {
    background: #E6F9EF;
    color: var(--positive-change);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.view-btn {
    background: rgba(38, 193, 101, 0.1);
    border: 1px solid rgba(38, 193, 101, 0.2);
    color: var(--primary-color);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dropdown Action Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.dropdown-menu {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 120px;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
    animation: dropdownShow 0.2s ease;
}

@keyframes dropdownShow {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
    text-align: left;
    border-radius: 0;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-item.delete {
    color: #ef4444;
}

.dropdown-item.delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-item.delete i {
    color: #ef4444;
}

.dropdown-item.delete:hover i {
    color: #dc2626;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0px 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-container.small {
    max-width: 500px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(38, 193, 101, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Members Section */
.members-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background: #f8fafc;
}

.members-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.members-header label {
    margin-bottom: 0;
    font-size: 16px;
}

.new-member-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.new-member-btn:hover {
    background: #1ea85b;
    transform: translateY(-1px);
}

.members-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
}

.members-search input {
    flex: 1;
    margin-bottom: 0;
}

.bulk-actions {
    display: flex;
    gap: 8px;
}

.bulk-actions button {
    background: rgba(38, 193, 101, 0.1);
    border: 1px solid rgba(38, 193, 101, 0.2);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bulk-actions button:hover {
    background: var(--primary-color);
    color: white;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.member-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 12px;
}

.member-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(38, 193, 101, 0.1);
}

.member-item input[type="checkbox"] {
    width: auto;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

.member-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    margin: 0;
    margin-bottom: 0;
    font-weight: normal;
}

.member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding-left: 8px;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.member-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.selected-count {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-cancel,
.btn-save {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-cancel {
    background: var(--primary-color);
    color: white;
}

.btn-cancel:hover {
    background: #1ea85b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    background: #1ea85b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Group Details Modal */
.group-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-group span {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Status Badge Fix */
.status-wrapper {
    display: flex;
    align-items: center;
}

.detail-group .status-badge {
    display: inline-block;
    width: auto;
    min-width: auto;
    white-space: nowrap;
}

/* Assignment Badge Styling */
.assignment-badge {
    display: inline-block;
    padding: 8px 12px;
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(38, 193, 101, 0.2);
}

.assignment-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(38, 193, 101, 0.3);
    background: linear-gradient(135deg, #22b35a, #1a9449);
}

/* Back to Groups Button Styling */
.back-to-groups-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(38, 193, 101, 0.2);
}

.back-to-groups-btn:hover {
    background: linear-gradient(135deg, #22b35a, #1a9449);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

.back-to-groups-btn i {
    font-size: 12px;
}


/* View Members Section */
.view-members-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.members-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.members-section-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.send-reminder-all-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: auto;
    min-width: max-content;
}

.send-reminder-all-btn:hover {
    background: #1ea85b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

/* Payment Statistics */
.payment-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-item.clickable {
    cursor: pointer;
}

.stat-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.25);
    border-color: var(--primary-color);
}

.stat-item.clickable.active {
    border: 2px solid var(--primary-color);
    background: rgba(38, 193, 101, 0.05);
    box-shadow: 0 2px 8px rgba(38, 193, 101, 0.15);
}

.stat-item.paid.clickable.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.stat-item.pending.clickable.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.stat-item.overdue.clickable.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
}

.stat-item.paid .stat-icon {
    background: #22c55e;
}

.stat-item.pending .stat-icon {
    background: #f59e0b;
}

.stat-item.overdue .stat-icon {
    background: #ef4444;
}

.stat-item.total .stat-icon {
    background: #6366f1;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.members-list-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s ease;
}

.member-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(38, 193, 101, 0.1);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.member-phone {
    font-size: 12px;
    color: var(--text-secondary);
}

.member-progress {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.payment-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.payment-status.paid {
    background: #e6f9ef;
    color: #22c55e;
}

.payment-status.pending {
    background: #fef3c7;
    color: #f59e0b;
}

.payment-status.overdue {
    background: #fef2f2;
    color: #ef4444;
}

.payment-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Member Action Buttons */
.member-actions {
    display: flex;
    align-items: center;
}

.send-reminder-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-reminder-btn:hover {
    background: #1ea85b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(38, 193, 101, 0.3);
}

.send-reminder-btn.urgent {
    background: #ef4444;
    animation: pulse 2s infinite;
}

.send-reminder-btn.urgent:hover {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.send-reminder-btn.paid {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.send-reminder-btn.paid:hover {
    background: #e5e7eb;
    transform: none;
    box-shadow: none;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Delete Confirmation Modal */
.delete-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
}

.warning-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 20px;
}

.delete-message h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.delete-message p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.warning-text {
    color: #ef4444 !important;
    font-size: 14px;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #22c55e;
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
    position: relative;
}

.toast.success {
    border-left-color: #22c55e;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.toast.success .toast-icon {
    background: #22c55e;
}

.toast.error .toast-icon {
    background: #ef4444;
}

.toast.warning .toast-icon {
    background: #f59e0b;
}

.toast.info .toast-icon {
    background: #3b82f6;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.toast-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    animation: progressBar 5s linear forwards;
}

.toast.success .toast-progress {
    background: #22c55e;
}

.toast.error .toast-progress {
    background: #ef4444;
}

.toast.warning .toast-progress {
    background: #f59e0b;
}

.toast.info .toast-progress {
    background: #3b82f6;
}

@keyframes progressBar {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Mobile Responsive - View Modal */
@media (max-width: 768px) {

    /* Main container padding adjustment for mobile */
    .widget.groups-table>div[style*="padding: 2rem"] {
        padding: 1rem !important;
    }

    /* Widget header mobile optimization */
    .widget-header {
        padding: 1rem 1rem 0.5rem 1rem;
    }

    .widget-header h3 {
        font-size: 18px;
        margin-bottom: 0;
    }

    /* Group details mobile optimization */
    .group-details {
        gap: 16px;
    }

    .view-members-section {
        margin-top: 24px;
        padding-top: 16px;
    }

    /* Payment Stats Mobile - Stack one by one */
    .payment-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
        margin-bottom: 20px;
    }

    /* Members Section Mobile */
    .members-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .members-section-header h4 {
        font-size: 16px;
    }

    .send-reminder-all-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        min-height: 44px;
        /* Better touch target */
        font-size: 14px;
        border-radius: 8px;
    }

    /* Improved button spacing in detail groups */
    .detail-group .send-reminder-all-btn {
        margin-top: 4px;
        font-size: 13px;
        padding: 10px 12px;
        min-height: 40px;
    }

    /* Member Cards Mobile */
    .member-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .member-card .member-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .member-info {
        gap: 6px;
        width: 100%;
    }

    .member-name {
        font-size: 15px;
    }

    .member-phone {
        font-size: 13px;
    }

    .member-progress {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .payment-status {
        font-size: 11px;
        padding: 6px 10px;
    }

    .payment-amount {
        font-size: 14px;
        font-weight: 700;
    }

    .member-actions {
        align-self: flex-end;
        position: absolute;
        top: 12px;
        right: 12px;
    }

    .member-card {
        position: relative;
        margin-bottom: 12px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #f0f4f8;
    }

    /* Improve send reminder button for mobile */
    .send-reminder-btn {
        min-width: 36px;
        min-height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }

    /* Detail Row Mobile */
    .detail-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .detail-group {
        gap: 6px;
    }

    .detail-group label {
        font-size: 12px;
    }

    .detail-group span {
        font-size: 15px;
    }

    /* Groups Table Mobile - Maintain full width */
    .groups-table {
        margin: 0 8px 16px 8px;
        padding: 16px;
        width: calc(100% - 16px);
        box-sizing: border-box;
    }

    /* Form Mobile - Add/Edit Group */
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }

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

    /* Members Section Mobile */
    .members-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .members-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .new-member-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .members-search {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }

    .bulk-actions {
        width: 100%;
        justify-content: space-between;
    }

    .members-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .member-item {
        padding: 12px;
    }

    .member-item label {
        font-size: 14px;
    }

    .member-name {
        font-size: 15px;
    }

    .member-details {
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    /* Dashboard (small phones) */
    .cards-header {
        padding: 0 12px;
    }

    .cards-container {
        padding: 0 12px;
        gap: 10px;
        margin-bottom: 14px;
    }

    .card {
        padding: 12px;
        min-height: 80px;
    }

    .card h2 {
        font-size: 18px;
    }

    .card-title {
        font-size: 11px;
    }

    .card-icon {
        width: 24px;
        height: 24px;
    }

    .three-column-section {
        margin: 0 12px 20px 12px;
    }

    .due-payments {
        padding: 14px 14px 0 14px;
        min-height: 260px;
    }

    .due-payments th,
    .due-payments td {
        padding: 9px 6px;
        font-size: 12px;
    }

    /* Due payments buttons: even smaller on small phones */
    .due-payments .btn {
        padding: 2px 4px;
        font-size: 9px;
    }

    /* Main container for very small screens */
    .widget.groups-table>div[style*="padding: 2rem"] {
        padding: 0.75rem !important;
    }

    .widget-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    }

    .widget-header h3 {
        font-size: 16px;
    }


    /* Member Cards Small Mobile */
    .member-card {
        padding: 12px;
        gap: 10px;
    }

    .member-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .member-name {
        font-size: 14px;
    }

    .member-phone {
        font-size: 12px;
    }

    .payment-status {
        font-size: 10px;
        padding: 4px 8px;
    }

    .payment-amount {
        font-size: 13px;
    }

    .send-reminder-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .member-actions {
        top: 12px;
        right: 12px;
    }

    .members-section-header h4 {
        font-size: 15px;
    }

    .send-reminder-all-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
        white-space: nowrap;
    }

    /* Better spacing for very small screens */
    .group-details {
        gap: 12px;
    }

    .view-members-section {
        margin-top: 20px;
        padding-top: 12px;
    }

    /* Optimize member info display */
    .member-info {
        gap: 4px;
    }

    .payment-status span {
        display: none;
        /* Hide text on very small screens, keep icon */
    }

    .payment-status i {
        margin-right: 0;
    }

    /* Adjust detail group button for small screens */
    .detail-group .send-reminder-all-btn {
        font-size: 11px;
        padding: 8px 10px;
        min-height: 36px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Groups Table Small Mobile - Maintain full width */
    .groups-table {
        margin: 0 4px 12px 4px;
        padding: 12px;
        width: calc(100% - 8px);
        box-sizing: border-box;
    }

    /* Form Small Mobile - Add/Edit Group */
    .members-section {
        padding: 12px;
    }

    .member-item {
        padding: 10px;
    }

    .member-name {
        font-size: 14px;
    }

    .member-details {
        font-size: 12px;
    }

    .new-member-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* Extra small screens optimization */
@media (max-width: 360px) {
    .widget.groups-table>div[style*="padding: 2rem"] {
        padding: 0.5rem !important;
    }

    /* Groups Table Extra Small - Maintain full width */
    .groups-table {
        margin: 0 2px 8px 2px;
        padding: 8px;
        width: calc(100% - 4px);
        box-sizing: border-box;
    }


    .member-card {
        padding: 10px;
        gap: 8px;
    }

    .detail-group .send-reminder-all-btn {
        font-size: 10px;
        padding: 6px 8px;
        min-height: 32px;
    }

    /* Ensure proper text wrapping */
    .member-name {
        word-break: break-word;
        hyphens: auto;
    }

    .member-phone {
        word-break: break-all;
    }

    /* Form Extra Small - Add/Edit Group */
    .members-section {
        padding: 8px;
    }

    .member-item {
        padding: 8px;
    }

    .member-name {
        font-size: 13px;
    }

    .member-details {
        font-size: 11px;
    }

    .new-member-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    /* Remove Assignment Modal Small Mobile */
    .modal-container.small {
        width: 98%;
        max-width: none;
        margin: 2vh auto;
        max-height: 96vh;
    }

    .remove-confirmation {
        gap: 12px;
        margin-bottom: 20px;
    }

    .confirmation-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .confirmation-message h4 {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .confirmation-message p {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .warning-text {
        font-size: 11px;
        padding: 6px;
        margin-top: 6px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }

    .btn-cancel,
    .btn-danger {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 13px;
    }
}

/* Mobile Toast Styles */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        align-items: stretch;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
    .cards-container {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        justify-items: stretch;
    }

    .content-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
        justify-items: stretch;
    }
}

/* Assignment Table Button Base Styling */
.remove-btn,
.assign-btn,
.assignment-table .view-btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
    min-width: auto;
    white-space: nowrap;
    transform: none;
    box-shadow: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    border: 1px solid;
}

/* Remove Button - Red */
.remove-btn {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.2);
}

.remove-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Assign Button - Green */
.assign-btn {
    background: rgba(38, 193, 101, 0.1);
    color: var(--primary-color);
    border-color: rgba(38, 193, 101, 0.2);
}

.assign-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Completed Button (view-btn) */
.assignment-table .view-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Assignment Modal Styles */
.btn-assign-data {
    background: #26C165;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: auto;
    min-width: max-content;
}

.btn-assign-data:hover {
    background: #1ea456;
    transform: translateY(-1px);
}

.assignment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border: 1px solid #e4e8ee;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.group-amount .summary-icon {
    background: linear-gradient(135deg, #26C165, #1ea456);
}

.total-months .summary-icon {
    background: linear-gradient(135deg, #4C7BF3, #3B67D6);
}

.assigned-months .summary-icon {
    background: linear-gradient(135deg, #26C165, #1ea456);
}

.remaining-months .summary-icon {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 14px;
    color: #858d99;
    font-weight: 500;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1c274c;
}

.assigned-count {
    color: #26C165;
}

.remaining-count {
    color: #ff6b6b;
}

.payment-status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.status-card {
    background: white;
    border: 1px solid #e4e8ee;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.status-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.status-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.paid-card .status-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.pending-card .status-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.overdue-card .status-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.total-card .status-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.status-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-number {
    font-size: 20px;
    font-weight: 700;
    color: #1c274c;
}

.status-label {
    font-size: 12px;
    color: #858d99;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Remove Assignment Confirmation Modal */
.confirmation-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.confirmation-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.confirmation-message {
    flex: 1;
}

.confirmation-message h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1c274c;
}

.confirmation-message p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.confirmation-message .warning-text {
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

.assignment-table-container {
    border: 1px solid #e4e8ee;
    border-radius: 8px;
    margin-bottom: 20px;
}

.assignment-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.assignment-table th {
    color: #6B7280;
    font-weight: 600;
    background: rgba(248, 250, 252, 0.8);
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    white-space: nowrap;
}

.assignment-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
}

.assignment-table tr:hover {
    background: rgba(248, 250, 252, 0.5);
}

.assignment-table tr.current-month {
    background: #e8f5e8;
}

.assignment-table tr.current-month:hover {
    background: #dff0df;
}

.assignment-table tr.unassigned {
    background: #fff5f5;
}

.assignment-table tr.unassigned:hover {
    background: #ffebeb;
}

.assignment-table tr:last-child td {
    border-bottom: none;
}

.unassigned-cell {
    text-align: center;
}

.unassigned-text {
    color: #858d99;
    font-style: italic;
}

.btn-remove-small,
.btn-assign-small {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.btn-remove-small {
    background: #ff6b6b;
    color: white;
}

.btn-remove-small:hover {
    background: #ff5252;
}

.btn-assign-small {
    background: #26C165;
    color: white;
}

.btn-assign-small:hover {
    background: #1ea456;
}

.btn-assign-member {
    background: #26C165;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-assign-member:hover {
    background: #1ea456;
    transform: translateY(-1px);
}

.assign-info {
    background: #f8f9fa;
    border: 1px solid #e4e8ee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.assign-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.assign-info span {
    color: #26C165;
    font-weight: 600;
}

.status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.upcoming {
    background: #cce7ff;
    color: #004085;
}

.status-badge.unassigned {
    background: #f8d7da;
    color: #721c24;
}

.assignment-cards {
    display: none;
}

.modal-container.large {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Mobile Responsive for Assignment Modal */
@media (max-width: 768px) {
    .assignment-summary {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-card {
        padding: 16px;
        gap: 12px;
    }

    .summary-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .summary-value {
        font-size: 20px;
    }

    .summary-label {
        font-size: 13px;
    }

    .assignment-table {
        min-width: 600px;
        font-size: 13px;
    }

    .assignment-cards {
        display: none;
    }

    .assignment-table th,
    .assignment-table td {
        padding: 8px 6px;
    }

    .btn-remove-small,
    .btn-assign-small {
        padding: 4px 8px;
        font-size: 11px;
        gap: 2px;
    }

    .btn-assign-member {
        padding: 10px 16px;
        font-size: 13px;
    }

    .modal-container.large {
        width: 98%;
        max-height: 95vh;
        margin: 2vh auto;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .btn-assign-data {
        padding: 4px 8px;
        font-size: 11px;
        gap: 3px;
    }

    .btn-assign-data i {
        font-size: 10px;
    }

    /* Assignment Table Buttons Mobile */
    .remove-btn,
    .assign-btn,
    .assignment-table .view-btn {
        width: 40% !important;
        justify-content: center !important;
        padding: 10px !important;
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .assignment-summary {
        grid-template-columns: 1fr;
    }

    .summary-card {
        flex-direction: column;
        text-align: center;
        padding: 12px;
        gap: 8px;
    }

    .summary-content {
        align-items: center;
    }


    .assignment-card {
        background: white;
        border: 1px solid #e4e8ee;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    }

    .assignment-card.current-month {
        background: #e8f5e8;
        border-color: #26C165;
    }

    .assignment-card.unassigned {
        background: #fff5f5;
        border-color: #ff6b6b;
    }

    .card-header {
        display: flex;
        justify-content: between;
        align-items: center;
        margin-bottom: 12px;
    }

    .card-month {
        font-weight: 600;
        color: #1c274c;
        font-size: 14px;
    }

    .card-status {
        margin-left: auto;
    }

    .card-body {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }

    .card-label {
        color: #858d99;
        font-weight: 500;
    }

    .card-value {
        color: #1c274c;
        font-weight: 600;
    }

    .card-member {
        color: #26C165;
    }

    .card-amount {
        color: #1c274c;
    }

    .card-actions {
        margin-top: 12px;
        text-align: center;
    }

    .modal-container.large {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-body {
        padding: 12px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-assign-member {
        width: 100%;
        justify-content: center;
    }

    .detail-row {
        flex-direction: column;
        gap: 12px;
    }

    .detail-group {
        width: 100%;
    }

    .detail-group .send-reminder-all-btn {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        font-size: 11px;
        padding: 8px 6px;
        text-align: center;
        justify-content: center;
    }

    .btn-assign-data {
        width: auto;
        justify-content: center;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Assignment Table Buttons Extra Small Mobile */
    .remove-btn,
    .assign-btn,
    .assignment-table .view-btn {
        width: 40% !important;
        justify-content: center !important;
        padding: 10px !important;
        font-size: 10px !important;
        min-width: auto !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Current Month Badge Styles */
.assigned-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.member-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.current-month-badge {
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Members Page Styles */
.members-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.members-table th {
    color: #6B7280;
    font-weight: 600;
    background: rgba(248, 250, 252, 0.8);
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #E4E8EE;
    font-size: 14px;
    white-space: nowrap;
}

.members-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #E4E8EE;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
    vertical-align: middle;
}

.members-table tr:hover {
    background: rgba(248, 250, 252, 0.5);
}

.members-table tr:last-child td {
    border-bottom: none;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    justify-content: flex-start;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #26C165, #1ea456);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.member-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.member-id {
    font-size: 12px;
    color: #858d99;
    font-weight: 400;
}

.address-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.address-info .street {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.address-info .city {
    font-size: 12px;
    color: #858d99;
    font-weight: 400;
}

.btn-view {
    background: #26C165;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: #1ea456;
    transform: translateY(-1px);
}

/* Member Modal Styles */
.member-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(248, 250, 252, 0.5);
    border-radius: 12px;
    border: 1px solid #E4E8EE;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #26C165, #1ea456);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.profile-info h4 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-info span {
    font-size: 14px;
    color: #858d99;
    font-weight: 500;
}

/* Members Table Responsive */
@media (max-width: 768px) {
    .members-table {
        font-size: 12px;
    }

    .member-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .member-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .address-info {
        font-size: 11px;
    }

    .btn-view {
        padding: 6px 12px;
        font-size: 11px;
    }

    .pagination-container {
        flex-direction: column;
        gap: 16px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Fix table container */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

.member-details-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.group-tag {
    background: rgba(38, 193, 101, 0.1);
    color: #26C165;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(38, 193, 101, 0.2);
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px 0;
    border-top: 1px solid #E4E8EE;
    background: white;
}

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

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    background: white;
    color: #6b7280;
    border: 1px solid #E4E8EE;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(248, 250, 252, 0.8);
    border-color: #26C165;
    color: #26C165;
}

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

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-number {
    background: white;
    color: #6b7280;
    border: 1px solid #E4E8EE;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-number:hover {
    background: rgba(248, 250, 252, 0.8);
    border-color: #26C165;
    color: #26C165;
}

.pagination-number.active {
    background: #26C165;
    color: white;
    border-color: #26C165;
}

@media (max-width: 1024px) {
    .three-column-section {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 0 20px 24px 20px;
    }

    .column-left,
    .column-center,
    .column-right {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .due-payments,
    .collection-summary,
    .quick-actions {
        padding: 20px 20px 0 20px;
        min-height: auto;
    }

    .due-payments {
        min-height: 350px;
    }

    .collection-summary {
        padding: 24px 20px 0 20px !important;
    }

    /* Groups Page Responsive */
    .groups-header {
        padding: 0 20px;
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .groups-actions {
        width: 100%;
        justify-content: space-between;
    }

    .groups-table {
        margin: 0 20px 24px 20px;
        padding: 20px;
    }

    .page-title {
        font-size: 24px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        z-index: 1000;
        height: 100%;
    }

    .sidebar.show {
        left: 0;
        box-shadow: 10px 0px 40px rgba(0, 0, 0, 0.1);
    }

    .container {
        position: relative;
    }

    .main-content {
        padding: 0;
        margin-left: 0;
    }

    .toggle-btn {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .cards-container {
        padding: 0 16px;
    }

    .content-grid {
        padding: 0 16px;
    }

    .three-column-section {
        grid-template-columns: 1fr;
        margin: 0 16px 24px 16px;
        gap: 16px;
    }

    .due-payments,
    .collection-summary,
    .quick-actions {
        padding: 20px 20px 0 20px;
    }

    .collection-summary {
        padding: 28px 24px 0 24px !important;
    }

    .quick-actions .widget-header {
        margin-bottom: 30px;
    }

    .due-payments {
        min-height: 350px;
    }

    .recent-transactions {
        padding: 20px;
        margin: 0 16px 24px 16px;
    }

    /* Pagination responsive */
    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .pagination-number {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0;
    }

    .main-header {
        flex-wrap: nowrap;
        padding: 12px 16px;
    }

    .header-left {}

    .header-right {
        justify-content: flex-end;
    }

    /* Dashboard cards: tighter spacing on mobile */
    .cards-header {
        padding: 0 16px;
    }

    .cards-container {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 16px;
        gap: 12px;
        align-items: stretch;
        justify-items: stretch;
        margin-bottom: 16px;
    }

    .card {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        min-height: 90px;
        padding: 14px;
    }

    .card h2 {
        font-size: 20px;
    }

    .card-title {
        font-size: 12px;
    }

    .card-icon {
        width: 28px;
        height: 28px;
    }

    /* Due payments: reduce padding/height on mobile */
    .due-payments {
        padding: 16px 16px 0 16px;
        min-height: 280px;
    }

    .due-payments th,
    .due-payments td {
        padding: 10px 8px;
        font-size: 12px;
    }

    /* Due payments buttons: smaller on mobile */
    .due-payments .btn {
        padding: 3px 6px;
        font-size: 10px;
    }

    .three-column-section {
        grid-template-columns: 1fr;
        margin: 0 16px 24px 16px;
        gap: 16px;
    }

    .column-left,
    .column-center,
    .column-right {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .due-payments table {
        width: 100%;
        table-layout: fixed;
    }

    .due-payments th,
    .due-payments td {
        word-wrap: break-word;
        overflow: hidden;
    }

    /* Due Payments Responsive Table Transformation */
    .due-payments .table-container {
        box-shadow: none;
    }

    .due-payments table {
        border: 0;
    }

    .due-payments thead {
        display: none;
    }

    .due-payments tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1.2rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        border: 1px solid #E4E8EE;
    }

    .due-payments td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 14px 0;
        text-align: right;
        font-size: 14px;
        line-height: 1.4;
    }

    .due-payments td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 13px;
    }

    .due-payments td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    /* Analytics more padding */
    .collection-summary {
        padding: 32px 24px 0 24px !important;
    }

    /* Groups Page Mobile */
    .groups-header {
        padding: 0 16px;
        margin-bottom: 20px;
    }

    .groups-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .add-group-btn {
        width: 100%;
        justify-content: center;
    }

    .groups-table {
        margin: 0 16px 24px 16px;
        padding: 18px;
    }

    .page-title {
        font-size: 22px;
    }

    /* Groups Table Mobile Transformation */
    .groups-table .table-container {
        box-shadow: none;
    }

    .groups-table table {
        border: 0;
    }

    .groups-table thead {
        display: none;
    }

    .groups-table tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1.2rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        border: 1px solid #E4E8EE;
    }

    .groups-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 14px 0;
        text-align: right;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    .groups-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 13px;
    }

    .groups-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    /* Assignment Table Mobile Transformation - Same as Groups Table */
    .groups-table .assignment-table-container {
        box-shadow: none;
        overflow: visible;
    }

    .groups-table .assignment-table {
        border: 0;
    }

    .groups-table .assignment-table thead {
        display: none;
    }

    .groups-table .assignment-table tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1.2rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        border: 1px solid #E4E8EE;
    }

    .groups-table .assignment-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 14px 0;
        text-align: right;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    .groups-table .assignment-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 13px;
    }

    .groups-table .assignment-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    /* Assignment Table Direct Mobile Styles (for assignment tables outside groups-table) */
    .assignment-table-container {
        overflow-x: auto;
        border-radius: 8px;
        margin: 0 auto;
        max-width: 100%;
    }

    .assignment-table {
        border: 0;
        min-width: auto;
        width: 100%;
    }

    .assignment-table thead {
        display: none;
    }

    .assignment-table tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1.2rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        border: 1px solid #E4E8EE;
    }

    .assignment-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 14px 0;
        text-align: right;
        font-size: 14px;
        line-height: 1.4;
        white-space: normal;
    }

    .assignment-table td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 13px;
    }

    .assignment-table td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .due-payments,
    .collection-summary,
    .quick-actions {
        padding: 18px 18px 0 18px;
    }

    .due-payments .widget-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .due-payments .widget-header h3 {
        font-size: 15px !important;
        white-space: nowrap;
    }

    .due-payments .urgent-badge {
        font-size: 11px;
        padding: 5px 10px;
        white-space: nowrap;
    }

    .quick-actions .widget-header {
        margin-bottom: 28px;
    }

    .quick-actions-grid {
        gap: 10px;
    }

    .due-payments {
        min-height: 320px;
    }

    .recent-transactions {
        padding: 18px;
        margin: 0 16px 24px 16px;
    }

    /* Pagination responsive */
    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .pagination-info {
        text-align: center;
        font-size: 13px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .pagination-number {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }

    /* Responsive Table Transformation */
    .recent-transactions .table-container {
        box-shadow: none;
    }

    .recent-transactions table {
        border: 0;
    }

    .recent-transactions thead {
        display: none;
    }

    .recent-transactions tr {
        display: block;
        border-bottom: 2px solid var(--background-color);
        margin-bottom: 1rem;
        border-radius: 10px;
        background: #fff;
        box-shadow: var(--card-shadow);
        padding: 1rem;
    }

    .recent-transactions td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted var(--border-color);
        padding: 12px 0;
        text-align: right;
    }

    .recent-transactions td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
    }

    .recent-transactions td:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px;
    }

    .cards-container {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 12px;
        gap: 12px;
        align-items: stretch;
        justify-items: stretch;
    }

    .card {
        padding: 16px;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        min-height: 110px;
    }

    .three-column-section {
        grid-template-columns: 1fr;
        margin: 0 12px 24px 12px;
        gap: 12px;
    }

    .column-left,
    .column-center,
    .column-right {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .due-payments table {
        table-layout: fixed;
    }

    .due-payments th,
    .due-payments td {
        font-size: 11px;
        padding: 8px 4px;
        word-wrap: break-word;
    }

    /* Due Payments Responsive Table Transformation */
    .due-payments .table-container {
        box-shadow: none;
    }

    .due-payments table {
        border: 0;
    }

    .due-payments thead {
        display: none;
    }

    .due-payments tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1rem;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.06);
        padding: 1rem;
        border: 1px solid #E4E8EE;
    }

    .due-payments td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 12px 0;
        text-align: right;
        font-size: 13px;
        line-height: 1.3;
    }

    .due-payments td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
    }

    .due-payments td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    /* Analytics more padding */
    .collection-summary {
        padding: 28px 20px 20px 20px !important;
    }

    .due-payments,
    .collection-summary,
    .quick-actions {
        padding: 16px 16px 0 16px;
    }

    .due-payments .widget-header h3,
    .collection-summary .widget-header h3,
    .quick-actions .widget-header h3 {
        font-size: 16px;
    }

    .due-payments .widget-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .due-payments .widget-header h3 {
        font-size: 14px !important;
        white-space: nowrap;
    }

    .due-payments .urgent-badge {
        font-size: 10px;
        padding: 4px 8px;
        white-space: nowrap;
    }

    .quick-actions .widget-header {
        margin-bottom: 24px;
    }

    .quick-action-btn {
        padding: 10px 12px;
        gap: 8px;
    }

    .quick-action-btn .btn-text {
        font-size: 12px;
    }

    .quick-action-btn .btn-icon {
        font-size: 16px;
    }

    .quick-actions-grid {
        gap: 8px;
        margin-bottom: 6px;
    }

    .due-payments {
        min-height: 280px;
    }

    .action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .recent-transactions {
        padding: 16px;
        margin: 0 12px 24px 12px;
    }

    /* Groups Page Small Mobile */
    .groups-header {
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .groups-table {
        margin: 0 12px 24px 12px;
        padding: 16px;
    }

    .add-group-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Groups Table Small Mobile */
    .groups-table tr {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
        box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.06);
    }

    .groups-table td {
        padding: 12px 0;
        font-size: 13px;
        line-height: 1.3;
    }

    .groups-table td::before {
        font-size: 12px;
        padding-right: 1rem;
    }

    /* Modal Responsive */
    .modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .modal-header {
        padding: 20px 16px 12px 16px;
    }

    .modal-body {
        padding: 20px 16px;
    }

    .members-search {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .bulk-actions {
        justify-content: center;
    }

    .members-grid {
        grid-template-columns: 1fr;
        max-height: 250px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-cancel,
    .btn-save {
        width: 100%;
        padding: 14px;
    }

    /* Pagination responsive */
    .pagination {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        padding-top: 12px;
    }

    .pagination-info {
        text-align: center;
        font-size: 12px;
        order: 2;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        order: 1;
    }

    .pagination-btn {
        padding: 6px 8px;
        font-size: 11px;
        gap: 3px;
    }

    .pagination-numbers {
        margin: 0 4px;
    }

    .pagination-number {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 28px;
    }

    .card h2 {
        font-size: 28px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .action-buttons button {
        width: 100%;
    }

    .header-icons {
        gap: 12px;
        font-size: 18px;
    }
}

/* Members Search Responsive */
@media (max-width: 768px) {
    .widget-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .filter-btn {
        width: 100%;
    }

    .filter-btn input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .widget-header {
        gap: 12px;
    }

    .widget-header h3 {
        font-size: 16px;
    }

    .filter-btn input {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }
}

/* Payment Action Buttons */
.payment-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 110px;
    text-align: center;
}

.payment-action-btn.mark-paid {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.payment-action-btn.mark-paid:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.payment-action-btn.mark-unpaid {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.payment-action-btn.mark-unpaid:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Payment Status Badges */
.status-badge.paid {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #86efac;
}

.status-badge.unpaid {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #fca5a5;
}

/* Ensure table cell alignment */
.recent-transactions td {
    text-align: center;
    vertical-align: middle;
}

.recent-transactions .action-cell {
    text-align: center;
    vertical-align: middle;
}

.recent-transactions .action-cell .payment-action-btn {
    display: inline-flex;
}

/* === NEW SCREEN STYLES === */

/* Page Header with Back Button */
.page-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.back-btn:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
    transform: translateX(-2px);
}

.back-btn i {
    font-size: 1rem;
}

.page-title-section {
    flex: 1;
    min-width: 0;
}

.page-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1.75rem;
    font-weight: 700;
}

.page-subtitle {
    margin: 0.25rem 0 0 0;
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 400;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Screen Content Container */
.screen-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Container */
.form-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.group-form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f8f9fa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(38, 193, 101, 0.1);
}

.form-note {
    color: #6c757d;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f8f9fa;
    margin-top: 2rem;
}

/* Details Cards */
.details-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 2rem;
}

.card-title {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;
    gap: 1rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span,
.detail-item p {
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Assignment Info Card */
.assignment-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.assigned-member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.member-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.member-details {
    flex: 1;
}

.member-details h4 {
    margin: 0 0 0.25rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.member-details p {
    margin: 0 0 0.25rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.assignment-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 1rem;
}

.assignment-status {
    text-align: right;
}

/* Members List Container */
.members-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
    transition: all 0.2s ease;
}

.member-card.paid {
    border-left-color: #28a745;
}

.member-card.pending {
    border-left-color: #ffc107;
}

.member-card.overdue {
    border-left-color: #dc3545;
}

.member-card:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

/* Payment Summary Grid */
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.summary-icon.success {
    background: #28a745;
}

.summary-icon.warning {
    background: #ffc107;
}

.summary-icon.danger {
    background: #dc3545;
}

.summary-icon.info {
    background: #17a2b8;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Quick Actions Grid */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-2px);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.action-btn span {
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

/* Assignment Timeline */
.timeline-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.assignment-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 50px;
    width: 2px;
    height: calc(100% + 1rem);
    background: #dee2e6;
}

.timeline-marker {
    flex-shrink: 0;
}

.timeline-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

.timeline-icon.completed {
    background: #28a745;
}

.timeline-icon.current {
    background: #ffc107;
}

.timeline-icon.upcoming {
    background: #17a2b8;
}

.timeline-icon.unassigned {
    background: #6c757d;
}

.timeline-content {
    flex: 1;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-title {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.timeline-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.timeline-status.completed {
    background: #d4edda;
    color: #155724;
}

.timeline-status.current {
    background: #fff3cd;
    color: #856404;
}

.timeline-status.upcoming {
    background: #d1ecf1;
    color: #0c5460;
}

.timeline-status.unassigned {
    background: #f8d7da;
    color: #721c24;
}

.timeline-details {
    margin-bottom: 1rem;
}

.assignment-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.collection-date {
    color: #28a745;
    font-weight: 500;
    font-style: italic;
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Assignment Management */
.assignment-summary {
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.stat-icon.completed {
    background: #28a745;
}

.stat-icon.current {
    background: #ffc107;
}

.stat-icon.upcoming {
    background: #17a2b8;
}

.stat-icon.total {
    background: #6f42c1;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.management-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.management-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.management-content {
    flex: 1;
}

.management-content h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.management-content p {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn-action {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-action:hover {
    background: #0056b3;
}

/* Small Action Buttons */
.action-btn-small {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.action-btn-small:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.action-btn-small.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn-small.secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.action-btn-small.success {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.action-btn-small.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.action-btn-small.warning {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.action-btn-small.info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.action-btn-small.primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.action-btn-small.secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

.action-btn-small.success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

.action-btn-small.danger:hover {
    background: #c82333;
    border-color: #c82333;
}

.action-btn-small.warning:hover {
    background: #e0a800;
    border-color: #e0a800;
}

.action-btn-small.info:hover {
    background: #138496;
    border-color: #138496;
}

/* Button Styles */
.btn-filter {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-filter.active,
.btn-filter:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Mobile Responsive - New Screens */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .page-header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .back-btn {
        align-self: flex-start;
    }

    .back-btn-text {
        display: none;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-actions {
        justify-content: stretch;
    }

    .page-actions button {
        flex: 1;
    }

    .form-container {
        margin: 0 -1rem;
        border-radius: 0;
    }

    .group-form {
        padding: 1.5rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .form-actions button {
        width: 100%;
        justify-content: center;
    }

    .details-card {
        margin: 0 -1rem;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .card-actions {
        justify-content: stretch;
    }

    .card-actions .btn-filter {
        flex: 1;
        text-align: center;
    }

    .assigned-member-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .assignment-status {
        text-align: center;
    }

    .payment-summary-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .management-grid {
        grid-template-columns: 1fr;
    }

    .management-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .timeline-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-item::before {
        display: none;
    }

    .timeline-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .assignment-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .timeline-actions {
        justify-content: center;
    }

    .timeline-filters {
        justify-content: stretch;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .form-section-title {
        font-size: 1.1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .timeline-filters {
        flex-direction: column;
    }

    .member-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .member-actions {
        justify-content: center;
    }
}

/* Assignment Summary Cards */
.assignment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s ease;
}

.summary-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.summary-card.group-amount .summary-icon {
    background: #28a745;
}

.summary-card.total-months .summary-icon {
    background: var(--primary-color);
}

.summary-card.assigned-months .summary-icon {
    background: #ffc107;
    color: #212529;
}

.summary-card.remaining-months .summary-icon {
    background: #dc3545;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Assignment Table */
.assignment-table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.assignment-table {
    width: 100%;
    border-collapse: collapse;
}

.assignment-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.assignment-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.assignment-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.current {
    background: #fff3cd;
    color: #856404;
}

.status-badge.assigned {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.pending {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons - Original Style */
.view-btn,
.assign-member-btn,
.remove-assignment-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.view-btn {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.view-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.assign-member-btn {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.assign-member-btn:hover {
    background: #c3e6cb;
    border-color: #b1dfbb;
    transform: none;
}

.remove-assignment-btn {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.remove-assignment-btn:hover {
    background: #f5c6cb;
    border-color: #f1b0b7;
    transform: none;
}

/* Assignment Modal Styles */
.assignment-modal-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.assignment-modal-info p {
    margin: 0.25rem 0;
    color: #495057;
}

.remove-confirmation {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.confirmation-icon {
    color: #ffc107;
    font-size: 2rem;
    flex-shrink: 0;
}

.confirmation-message h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.confirmation-message p {
    margin: 0 0 1rem 0;
    color: #6c757d;
}

.warning-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff3cd;
    padding: 0.75rem;
    border-radius: 4px;
    color: #856404;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .assignment-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .summary-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .assignment-table th,
    .assignment-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }

    .assign-member-btn,
    .remove-assignment-btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .remove-confirmation {
        flex-direction: column;
        text-align: center;
    }

    /* Remove Assignment Modal Mobile */
    .modal-container.small {
        width: 95%;
        max-width: 400px;
        margin: 5vh auto;
    }

    .remove-confirmation {
        gap: 16px;
    }

    .confirmation-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin: 0 auto;
    }

    .confirmation-message h4 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .confirmation-message p {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .warning-text {
        font-size: 12px;
        padding: 8px;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .assignment-summary {
        grid-template-columns: 1fr;
    }

    .assignment-table-container {
        overflow-x: auto;
    }

    .assignment-table {
        min-width: 600px;
    }
}

/* Mobile responsive for payment features */
@media (max-width: 768px) {

    /* Payments Header Mobile */
    .groups-header {
        padding: 0 16px;
        margin-bottom: 16px;
    }

    .groups-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .add-group-btn {
        width: 100%;
        justify-content: center;
    }

    /* Payments Table Mobile */
    .recent-transactions {
        margin: 0 16px 24px 16px;
        padding: 16px;
    }

    .widget-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .filter-btn {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .filter-btn select,
    .filter-btn input {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Payment Action Buttons Mobile */
    .payment-action-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 85px;
        gap: 4px;
    }

    /* Payment Status Badges Mobile */
    .status-badge.paid,
    .status-badge.unpaid {
        padding: 4px 6px;
        font-size: 10px;
        gap: 2px;
        border-radius: 12px;
    }

    /* Payments Table Transformation */
    .recent-transactions .table-container {
        box-shadow: none;
    }

    .recent-transactions table {
        border: 0;
    }

    .recent-transactions thead {
        display: none;
    }

    .recent-transactions tr {
        display: block;
        border-bottom: 3px solid #F0F2F5;
        margin-bottom: 1.2rem;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
        padding: 1.2rem;
        border: 1px solid #E4E8EE;
    }

    .recent-transactions td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #E4E8EE;
        padding: 12px 0;
        text-align: right;
        font-size: 13px;
        line-height: 1.4;
    }

    .recent-transactions td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
        min-width: 80px;
    }

    .recent-transactions td:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .recent-transactions .action-cell {
        padding: 12px 0;
        justify-content: space-between;
        align-items: center;
    }

    /* General mobile styles for all action cells */
    .action-cell {
        justify-content: space-between !important;
        padding: 12px 0;
        align-items: center;
    }

    /* Payments mobile: keep action dots aligned nicely with label */
    .payments-table .action-cell {
        justify-content: space-between !important;
        padding: 12px 0;
    }
    
    .payments-table .action-cell::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
        min-width: 60px;
    }

    /* Agents table mobile: keep action dots aligned nicely with label */
    .agents-table .action-cell {
        justify-content: space-between !important;
        padding: 12px 0;
    }
    
    .agents-table .action-cell::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
        min-width: 60px;
    }

    /* Members table mobile: keep action dots aligned nicely with label */
    .members-table .action-cell {
        justify-content: space-between !important;
        padding: 12px 0;
    }
    
    .members-table .action-cell::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
        min-width: 60px;
    }

    .recent-transactions .action-cell::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        padding-right: 1rem;
        color: #6B7280;
        font-size: 12px;
        min-width: 60px;
    }


    /* Pagination Mobile */
    .pagination-container {
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: 16px 0;
    }

    .pagination-info {
        text-align: center;
        font-size: 13px;
        order: 2;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        order: 1;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .pagination-number {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 32px;
    }
}

@media (max-width: 480px) {

    /* Extra Small Mobile */
    .groups-header {
        padding: 0 12px;
        margin-bottom: 12px;
    }

    .page-title {
        font-size: 20px;
    }

    .add-group-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .recent-transactions {
        margin: 0 12px 24px 12px;
        padding: 12px;
    }

    .recent-transactions tr {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .recent-transactions td {
        padding: 10px 0;
        font-size: 12px;
    }

    .recent-transactions td::before {
        font-size: 11px;
        min-width: 70px;
    }

    .payment-action-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-width: 70px;
        gap: 3px;
    }

    .status-badge.paid,
    .status-badge.unpaid {
        padding: 3px 5px;
        font-size: 9px;
        gap: 2px;
        border-radius: 10px;
    }


    .filter-btn {
        gap: 6px;
    }

    .pagination-container {
        padding: 12px 0;
        gap: 10px;
    }

    .pagination-info {
        font-size: 12px;
    }

    .pagination-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .pagination-number {
        padding: 5px 6px;
        font-size: 11px;
        min-width: 28px;
    }
}

/* Member View Modal Styles */
.member-view-modal {
    max-width: 700px;
}

.member-view-header {
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    padding: 24px;
    border-radius: 12px 12px 0 0;
    position: relative;
}

.member-header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.member-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.member-header-text h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.member-header-text p {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.member-view-header .status-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.member-view-header .modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.member-view-header .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.member-view-body {
    padding: 32px 24px;
}

.member-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #26C165, #1ea456);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #26C165;
}

.info-card:hover::before {
    opacity: 1;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.info-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.2;
}

.address-section,
.groups-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.address-section h4,
.groups-section h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #1e293b;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address-section h4 i,
.groups-section h4 i {
    color: #26C165;
    font-size: 20px;
}

.address-section p {
    margin: 0;
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    padding: 12px 0;
}

.member-groups-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-groups-display .group-tag {
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 4px rgba(38, 193, 101, 0.2);
}

.member-view-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    margin-top: 0;
}

.member-view-actions .btn-cancel,
.member-view-actions .btn-save {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.member-view-actions .btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.member-view-actions .btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

.member-view-actions .btn-save {
    background: linear-gradient(135deg, #26C165, #1ea456);
    color: white;
    border: none;
}

.member-view-actions .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 193, 101, 0.3);
}

a{
    text-decoration: none;
}
/* Payments Pagination Styles - Unique Class Names */
.payments-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.payments-pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.payments-pagination {
    display: flex;
    align-items: center;
}

.payments-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.payments-pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.payments-pagination-btn:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.payments-pagination-btn i {
    margin: 0 4px;
}

.payments-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 16px;
}

.payments-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.payments-page-number:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.payments-page-number.active {
    color: #fff;
    background-color: #26C165;
    border-color: #26C165;
}

.payments-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 768px) {
    .payments-pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .payments-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .payments-pagination-numbers {
        margin: 0 8px;
    }
}
/* Recent Transaction Pagination Styles - Unique Class Names */
.recent-transactions-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.recent-transactions-pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.recent-transactions-pagination {
    display: flex;
    align-items: center;
}

.recent-transactions-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-transactions-pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.recent-transactions-pagination-btn:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.recent-transactions-pagination-btn i {
    margin: 0 4px;
}

.recent-transactions-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 16px;
}

.recent-transactions-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.recent-transactions-page-number:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.recent-transactions-page-number.active {
    color: #fff;
    background-color: #26C165;
    border-color: #26C165;
}

.recent-transactions-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 768px) {
    .recent-transactions-pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .recent-transactions-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .recent-transactions-pagination-numbers {
        margin: 0 8px;
    }
}

/* Pending Payments Pagination Styles - Unique Class Names */
.pending-payments-pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
}

.pending-payments-pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.pending-payments-pagination {
    display: flex;
    align-items: center;
}

.pending-payments-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-payments-pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.pending-payments-pagination-btn:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.pending-payments-pagination-btn i {
    margin: 0 4px;
}

.pending-payments-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 16px;
}

.pending-payments-page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.pending-payments-page-number:hover {
    color: #26C165;
    background-color: #f8f9fa;
    border-color: #26C165;
    text-decoration: none;
}

.pending-payments-page-number.active {
    color: #fff;
    background-color: #26C165;
    border-color: #26C165;
}

.pending-payments-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    color: #6c757d;
    font-weight: 500;
}

@media (max-width: 768px) {
    .pending-payments-pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .pending-payments-pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pending-payments-pagination-numbers {
        margin: 0 8px;
    }
}
/* Mobile Responsive for Member View */
@media (max-width: 768px) {
    .member-view-modal {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .modal-overlay {
        padding: 20px;
        box-sizing: border-box;
    }

    .modal-container {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .member-view-header {
        padding: 20px;
    }

    .member-header-info {
        gap: 16px;
    }

    .member-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .member-header-text h3 {
        font-size: 20px;
    }

    .member-header-text p {
        font-size: 14px;
    }

    .member-view-body {
        padding: 20px;
    }

    .member-info-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .info-card {
        padding: 16px;
        gap: 12px;
    }

    .info-card-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .address-section,
    .groups-section {
        padding: 16px;
    }

    .member-view-actions {
        flex-direction: column;
        gap: 8px;
    }

    .member-view-actions .btn-cancel,
    .member-view-actions .btn-save {
        width: 100%;
        justify-content: center;
    }
}