/* Group Savings & Loan Manager - Clean Islamic / Madani Theme */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Base Container */
.gslm-frontend-wrapper.islamic-theme {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ffffff;
    /* border-radius: 16px; */
    padding: 24px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); */
    /* border: 1px solid #e2e8f0; */
    /* margin: 20px 0; */
    color: #1e293b;
    box-sizing: border-box;
    max-width: 100%;
}

.gslm-frontend-wrapper *,
.gslm-frontend-wrapper *::before,
.gslm-frontend-wrapper *::after {
    box-sizing: border-box;
}

/* Hero Header */
.gslm-frontend-wrapper .gslm-hero-header {
    background: linear-gradient(135deg, #043322 0%, #064e3b 60%, #022c22 100%);
    color: #ffffff;
    padding: 24px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    text-align: center;
    border-top: 3px solid #d4af37;
    box-shadow: 0 6px 20px rgba(4, 51, 34, 0.2);
}

.gslm-frontend-wrapper .gslm-hero-header h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.gslm-frontend-wrapper .islamic-subtitle {
    margin: 0 0 10px 0;
    font-size: 13.5px;
    color: #d1fae5;
    opacity: 0.92;
    line-height: 1.4;
}

.gslm-frontend-wrapper .islamic-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 200px;
    margin: 0 auto;
}

.gslm-frontend-wrapper .divider-line {
    flex: 1;
    height: 1px;
    background: rgba(251, 191, 36, 0.5);
}

.gslm-frontend-wrapper .divider-star {
    color: #fbbf24;
    font-size: 11px;
}

.gslm-hero-header p:empty,
.gslm-frontend-wrapper p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.gslm-hero-header br,
.islamic-divider br {
    display: none !important;
}

/* Stats Overview Grid */
.gslm-front-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.gslm-front-card {
    padding: 18px 20px;
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.gslm-front-card p {
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}

.card-emerald { background: linear-gradient(135deg, #065f46 0%, #047857 100%); }
.card-blue { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); }
.card-purple { background: linear-gradient(135deg, #581c87 0%, #7c3aed 100%); }
.card-rose { background: linear-gradient(135deg, #9f1239 0%, #e11d48 100%); }

.card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fef08a;
    opacity: 0.95;
    margin-bottom: 6px;
}

.card-val {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
    color: #ffffff;
    line-height: 1.2;
}

.card-sub {
    font-size: 12px;
    color: #e2e8f0;
    opacity: 0.9;
}

/* Navigation Tabs */
.gslm-front-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gslm-tab-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid transparent;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.gslm-tab-btn:hover {
    background: #f0fdf4;
    color: #064e3b;
}

.gslm-tab-btn.active {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    color: #fbbf24;
    border-color: #064e3b;
    border-bottom: 2px solid #064e3b;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(6, 78, 59, 0.2);
}

.gslm-tab-content {
    display: none;
}

.gslm-tab-content.active {
    display: block;
    animation: gslmSmoothTabIn 0.2s ease-in-out;
}

@keyframes gslmSmoothTabIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Table Cards */
.gslm-table-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.islamic-card-heading {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 17px;
    font-weight: 800;
    color: #064e3b;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.35;
}

.heading-ornament {
    color: #d4af37;
    font-size: 14px;
}

/* Header Flex for Filter and Title */
.gslm-card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.gslm-card-header-flex .islamic-card-heading {
    margin-bottom: 0;
}

.gslm-month-filter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gslm-month-filter-wrap label {
    font-weight: 700;
    font-size: 13px;
    color: #064e3b;
    white-space: nowrap;
}

.gslm-month-select {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-weight: 600;
    font-family: inherit;
    font-size: 13.5px;
    color: #064e3b;
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gslm-month-select:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Table Responsive Wrapper & Notice */
.gslm-scroll-notice {
    display: none;
}

.gslm-responsive-table {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.gslm-responsive-table::-webkit-scrollbar {
    height: 5px;
}

.gslm-responsive-table::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.gslm-responsive-table::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.gslm-responsive-table::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.gslm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #ffffff;
    text-align: left;
}

.gslm-table th, .gslm-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.gslm-table th {
    background: #064e3b;
    color: #ffffff;
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #d4af37;
    white-space: nowrap;
}

.gslm-table tbody tr:nth-child(even) {
    background: #fbfdfa;
}

.gslm-table tbody tr:hover td {
    background: #f0fdf4;
}

.col-num {
    text-align: center;
    width: 40px;
    color: #64748b;
    font-weight: 600;
}

.col-member {
    color: #064e3b;
}

.text-green { color: #059669; font-weight: 700; }
.text-red { color: #dc2626; font-weight: 700; }
.text-orange { color: #d97706; font-weight: 700; }
.font-bold { font-weight: 700; }

/* Deposit Rule Banner */
.gslm-deposit-rule-banner {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #059669;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    color: #064e3b;
}

.gslm-deposit-rule-banner .rule-icon {
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
}

.gslm-deposit-rule-banner p {
    margin: 4px 0 0 0 !important;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.5;
}

/* Monthly Summary Strip */
.gslm-month-summary-strip {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.summary-pill {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-pill .pill-lbl {
    font-weight: 600;
}

.summary-pill .pill-val {
    font-weight: 700;
}

.summary-pill.green { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.summary-pill.red { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.summary-pill.orange { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.summary-pill.blue { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.summary-pill.gray { background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; }

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-active { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-extended { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-overdue { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Table Footer Styles */
.gslm-deposits-tfoot {
    background: #f8fafc;
    font-weight: bold;
    border-top: 2px solid #cbd5e1;
}

.tfoot-label {
    text-align: right;
    font-size: 13.5px;
    color: #1e293b;
}

/* Calculator UI */
.gslm-calc-form {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    max-width: 480px;
}

.gslm-input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #064e3b;
    font-size: 13.5px;
}

.gslm-input-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
    font-family: inherit;
}

.gslm-input-group input:focus {
    border-color: #059669;
    outline: none;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}

.gslm-calc-result-box {
    margin-top: 16px;
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 13.5px;
}

.result-row.total {
    border-bottom: none;
    font-size: 15px;
    font-weight: 800;
    color: #064e3b;
    padding-top: 10px;
}

.gslm-calc-extension-note {
    margin-top: 14px;
    background: #fffbeb;
    padding: 10px 12px;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    font-size: 12.5px;
    color: #92400e;
}

/* =========================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================= */

/* Medium Screens / Tablets (<= 960px) */
@media (max-width: 960px) {
    .gslm-front-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .gslm-frontend-wrapper {
        padding: 16px;
    }

    .gslm-hero-header {
        padding: 20px 16px;
        margin-bottom: 16px;
    }

    .gslm-hero-header h2 {
        font-size: 20px;
    }

    .islamic-subtitle {
        font-size: 12.5px;
    }

    /* Swipeable Horizontal Navigation Bar on Mobile */
    .gslm-front-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 2px 2px 8px 2px;
        margin-bottom: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .gslm-front-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .gslm-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 13px;
        min-height: 38px;
        border-radius: 8px;
        margin-bottom: 0;
        border: 1px solid #e2e8f0;
    }

    .gslm-tab-btn.active {
        border-bottom: 1px solid #064e3b;
    }

    /* Scroll Notice for wide tables */
    .gslm-scroll-notice {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11.5px;
        font-weight: 600;
        color: #475569;
        background: #f8fafc;
        padding: 6px 10px;
        border-radius: 6px;
        border: 1px dashed #cbd5e1;
        margin-bottom: 8px;
        width: fit-content;
    }

    .gslm-scroll-notice .scroll-icon {
        color: #059669;
        font-size: 14px;
    }
}

/* Standard Mobile Devices (<= 640px) */
@media (max-width: 640px) {
    .gslm-frontend-wrapper {
        padding: 12px;
    }

    .gslm-hero-header {
        padding: 16px 12px;
        border-radius: 10px;
    }

    .gslm-hero-header h2 {
        font-size: 18px;
        letter-spacing: -0.2px;
    }

    .islamic-subtitle {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .islamic-divider {
        max-width: 140px;
    }

    /* 2x2 Clean Compact Grid on Mobile */
    .gslm-front-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .gslm-front-card {
        padding: 12px 10px;
        border-radius: 10px;
        min-height: 86px;
    }

    .card-title {
        font-size: 10.5px;
        letter-spacing: 0.3px;
        margin-bottom: 4px;
        line-height: 1.25;
    }

    .card-val {
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -0.3px;
        margin-bottom: 2px;
    }

    .card-sub {
        font-size: 10px;
        line-height: 1.25;
        opacity: 0.85;
    }

    /* Table Cards on Mobile */
    .gslm-table-card {
        padding: 12px 10px;
        border-radius: 10px;
    }

    .islamic-card-heading {
        font-size: 14.5px;
        margin-bottom: 12px;
    }

    /* Card Header and Month Selector Stack */
    .gslm-card-header-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .gslm-month-filter-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .gslm-month-select {
        flex: 1;
        max-width: 200px;
        padding: 8px 12px;
        font-size: 13px;
        height: 38px;
    }

    /* Deposit Rule Banner */
    .gslm-deposit-rule-banner {
        padding: 10px 12px;
        gap: 10px;
        font-size: 12px;
        margin-bottom: 12px;
    }

    .gslm-deposit-rule-banner p {
        font-size: 11.5px;
        line-height: 1.45;
    }

    /* Monthly Summary Pills Stacked */
    .gslm-month-summary-strip {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }

    .summary-pill {
        padding: 8px 12px;
        font-size: 12px;
        justify-content: space-between;
        width: 100%;
        border-radius: 8px;
    }

    /* Compact Table Typography & Sizing */
    .gslm-table {
        font-size: 12px;
    }

    .gslm-table th, .gslm-table td {
        padding: 9px 10px;
        white-space: nowrap;
    }

    .gslm-table th {
        font-size: 11.5px;
        padding: 9px 10px;
    }

    .col-member strong {
        font-size: 12.5px;
    }

    .badge {
        font-size: 10.5px;
        padding: 3px 8px;
    }

    .tfoot-label {
        font-size: 12px;
    }
}

/* Small Screens (<= 400px) */
@media (max-width: 400px) {
    .gslm-frontend-wrapper {
        padding: 8px;
    }

    .gslm-front-stats-grid {
        gap: 8px;
    }

    .gslm-front-card {
        padding: 10px 8px;
    }

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

    .card-val {
        font-size: 15px;
    }

    .card-sub {
        font-size: 9.5px;
    }

    .gslm-tab-btn {
        padding: 7px 11px;
        font-size: 12px;
    }

    .islamic-card-heading {
        font-size: 13.5px;
    }
}
