:root{
    --primary:#0f4c81;
    --primary-2:#1769aa;
    --success:#16a34a;
    --danger:#dc2626;
    --warning:#f59e0b;
    --purple:#7c3aed;
    --pink:#db2777;
    --dark:#0f172a;
    --bg:#f3f6fb;
    --card:#ffffff;
    --text:#0f172a;
    --muted:#64748b;
    --line:#e2e8f0;
    --soft:#eef7ff;
    --radius:20px;
    --shadow:0 12px 30px rgba(15,23,42,.08);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
    margin:0;
    font-family:"Segoe UI",Arial,sans-serif;
    background:var(--bg);
    color:var(--text);
}

a{
    color:var(--primary);
    text-decoration:none;
}

.container,
.v3-content{
    max-width:1450px;
    margin:auto;
    padding:28px;
}

/* GLOBAL CARDS */

.card{
    background:var(--card);
    border-radius:var(--radius);
    padding:26px;
    box-shadow:var(--shadow);
    border:1px solid rgba(226,232,240,.85);
}

.card h1,
.card h2,
.card h3,
.card h4{
    margin-top:0;
    color:var(--primary);
}

.card-title{
    margin-bottom:18px;
}

.card-title h3{
    margin:0 0 6px;
    font-size:21px;
}

.card-title p,
.muted{
    margin:0;
    color:var(--muted);
    font-size:14px;
    line-height:1.6;
}

/* GRID */

.grid{
    display:grid;
    gap:22px;
}

.grid.two{grid-template-columns:repeat(2,1fr)}
.grid.three{grid-template-columns:repeat(3,1fr)}
.grid.four{grid-template-columns:repeat(4,1fr)}
.mt{margin-top:22px}

/* HERO */

.hero,
.portal-hero,
.page-head{
    background:
        radial-gradient(circle at top right,rgba(255,255,255,.22),transparent 32%),
        linear-gradient(135deg,var(--primary),var(--success));
    color:#fff;
    padding:36px;
    border-radius:28px;
    box-shadow:0 20px 45px rgba(15,76,129,.22);
    margin-bottom:24px;
}

.hero h1,
.portal-hero h1,
.page-head h1{
    margin:0;
    font-size:34px;
    line-height:1.15;
}

.hero p,
.portal-hero p,
.page-head p{
    margin:10px 0 0;
    opacity:.92;
}

.eyebrow{
    display:inline-block;
    background:rgba(255,255,255,.18);
    padding:7px 13px;
    border-radius:999px;
    font-size:13px;
    font-weight:900;
    margin-bottom:12px;
}

/* MEMBER PORTAL SHELL */

.page-shell{
    display:grid;
    grid-template-columns:290px 1fr;
    gap:24px;
    align-items:start;
}

.side-card{
    position:sticky;
    top:94px;
    background:#0f172a;
    color:#fff;
    border-radius:24px;
    padding:22px;
    box-shadow:0 18px 40px rgba(15,23,42,.18);
}

.side-profile{
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.12);
    border-radius:18px;
    padding:18px;
    margin-bottom:18px;
}

.side-profile h3{
    margin:0 0 8px;
    color:#fff;
    font-size:18px;
}

.side-profile p{
    margin:0;
    color:#cbd5e1;
    font-size:13px;
    text-transform:capitalize;
}

.side-nav{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.side-nav a{
    color:#cbd5e1;
    padding:13px 14px;
    border-radius:14px;
    font-weight:800;
    display:flex;
    align-items:center;
    gap:10px;
}

.side-nav a:hover,
.side-nav a.active{
    background:linear-gradient(135deg,var(--primary),var(--success));
    color:#fff;
}

/* METRICS */

.metric{
    position:relative;
    overflow:hidden;
}

.metric::after{
    content:"";
    position:absolute;
    width:90px;
    height:90px;
    border-radius:50%;
    background:rgba(15,76,129,.08);
    right:-24px;
    top:-24px;
}

.metric span{
    display:block;
    color:var(--muted);
    font-weight:800;
    margin-bottom:8px;
    font-size:14px;
}

.metric b{
    display:block;
    color:var(--primary);
    font-size:28px;
    line-height:1.2;
}

/* QUICK ACTIONS */

.quick-actions{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:18px;
}

.action-tile,
.quick-action{
    background:#fff;
    border-radius:22px;
    padding:22px;
    box-shadow:var(--shadow);
    border:1px solid var(--line);
    color:var(--primary);
    font-weight:900;
    display:flex;
    align-items:center;
    gap:10px;
    transition:.2s;
}

.action-tile:hover,
.quick-action:hover{
    transform:translateY(-3px);
    background:var(--primary);
    color:#fff;
}

/* SECTION TITLES */

.section-title{
    color:var(--primary);
    margin:30px 0 15px;
    font-size:22px;
    font-weight:900;
}

/* FORM */

label{
    display:block;
    margin:11px 0 6px;
    font-weight:900;
    color:#334155;
    font-size:14px;
}

input,
select,
textarea{
    width:100%;
    padding:13px 15px;
    border:1px solid #dbe2ea;
    border-radius:13px;
    margin-bottom:10px;
    font-size:14px;
    background:#fff;
}

input:focus,
select:focus,
textarea:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 4px rgba(15,76,129,.10);
}

textarea{min-height:86px}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:14px;
}

/* BUTTONS */

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    border-radius:13px;
    padding:12px 18px;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:#fff;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 10px 20px rgba(15,76,129,.16);
}

.btn:hover{
    transform:translateY(-1px);
    color:#fff;
}

.btn.light{
    background:#eef7ff;
    color:var(--primary);
    box-shadow:none;
}

.btn.success{background:linear-gradient(135deg,var(--success),#0f7a36)}
.btn.danger{background:linear-gradient(135deg,var(--danger),#b91c1c)}
.btn.small{padding:8px 11px;font-size:12px;border-radius:10px}

/* SPECIAL CARDS */

.payment-card{border-top:6px solid var(--success)}
.action-card{border-top:6px solid var(--primary)}
.repayment-card{border-top:6px solid var(--purple)}
.welfare-card{border-top:6px solid var(--pink)}

.info-box{
    background:var(--soft);
    border-left:5px solid var(--primary);
    padding:16px;
    border-radius:14px;
    margin-top:18px;
    color:#334155;
    line-height:1.8;
}

/* TABLE */

.table-wrap{
    overflow-x:auto;
    border-radius:16px;
}

table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:16px;
    overflow:hidden;
}

th{
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:#fff;
    text-align:left;
    padding:14px;
    white-space:nowrap;
    font-size:13px;
}

td{
    padding:13px;
    border-bottom:1px solid var(--line);
    white-space:nowrap;
    color:#334155;
    font-size:14px;
}

tr:hover td{background:#f8fafc}

/* BADGES */

.badge{
    display:inline-block;
    padding:6px 12px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
    text-transform:capitalize;
}

.badge.pending,
.badge.unread{
    background:#fef3c7;
    color:#92400e;
}

.badge.approved,
.badge.completed,
.badge.paid,
.badge.active,
.badge.read{
    background:#dcfce7;
    color:#166534;
}

.badge.rejected,
.badge.inactive,
.badge.suspended{
    background:#fee2e2;
    color:#991b1b;
}

/* ALERTS */

.alert{
    padding:15px 18px;
    border-radius:14px;
    margin-bottom:16px;
    font-weight:800;
}

.alert.success{background:#dcfce7;color:#166534}
.alert.error{background:#fee2e2;color:#991b1b}
.alert.warning{background:#fef3c7;color:#92400e}

/* TIMELINE */

.timeline{
    display:flex;
    flex-direction:column;
    gap:15px;
}

.timeline-item{
    display:flex;
    align-items:flex-start;
    gap:14px;
    padding-bottom:15px;
    border-bottom:1px solid var(--line);
}

.timeline-item:last-child{border-bottom:none}

.timeline-icon{
    width:38px;
    height:38px;
    border-radius:50%;
    background:#dcfce7;
    color:#166534;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* PROGRESS */

.progress{
    width:100%;
    height:13px;
    background:#e5e7eb;
    border-radius:999px;
    overflow:hidden;
}

.progress span{
    display:block;
    height:100%;
    background:linear-gradient(135deg,var(--primary),var(--success));
}

/* STATEMENTS */

.statement-card{
    text-align:center;
}

.statement-card i{
    font-size:34px;
    color:var(--primary);
    margin-bottom:12px;
}

/* NOTIFICATIONS */

.note-item{
    display:flex;
    justify-content:space-between;
    gap:15px;
    border-bottom:1px solid var(--line);
    padding:16px 0;
}

.note-item:last-child{border-bottom:none}

.note-item p{
    margin:6px 0;
    color:#475569;
}

/* FOOTER */

.v3-footer,
.footer{
    margin-top:50px;
    padding:24px;
    text-align:center;
    color:var(--muted);
}

/* PRINT */

@media print{
    .no-print,
    .side-card,
    .v3-sidebar,
    .v3-topbar,
    .btn{
        display:none!important;
    }

    .page-shell{
        display:block;
    }

    body{
        background:#fff;
    }

    .card{
        box-shadow:none;
        border:1px solid #ddd;
    }
}

/* RESPONSIVE */

@media(max-width:1200px){
    .page-shell{
        grid-template-columns:1fr;
    }

    .side-card{
        position:relative;
        top:auto;
    }

    .side-nav{
        display:grid;
        grid-template-columns:repeat(2,1fr);
    }

    .grid.four,
    .quick-actions{
        grid-template-columns:repeat(2,1fr);
    }

    .grid.three,
    .grid.two{
        grid-template-columns:1fr;
    }
}

@media(max-width:700px){
    .container,
    .v3-content{
        padding:16px;
    }

    .hero,
    .portal-hero,
    .page-head{
        padding:26px;
        border-radius:22px;
    }

    .hero h1,
    .portal-hero h1,
    .page-head h1{
        font-size:26px;
    }

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

    .grid.four,
    .quick-actions,
    .side-nav,
    .form-grid{
        grid-template-columns:1fr;
    }

    .action-tile{
        justify-content:center;
        text-align:center;
    }

    .metric b{
        font-size:24px;
    }

    th,td{
        padding:11px;
        font-size:13px;
    }

    .btn{
        width:100%;
    }

    .note-item{
        flex-direction:column;
    }
}

.side-avatar{
    width:64px;
    height:64px;
    border-radius:20px;
    background:linear-gradient(135deg,#0f4c81,#16a34a);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    font-weight:900;
    margin-bottom:14px;
}

.member-content{
    min-width:0;
}



/* ===============================
   BACK TO TOP
=============================== */

.backTop{

    position:fixed;

    right:20px;

    bottom:20px;

    width:50px;

    height:50px;

    border:none;

    border-radius:50%;

    background:linear-gradient(135deg,#0f4c81,#16a34a);

    color:#fff;

    font-size:22px;

    cursor:pointer;

    box-shadow:0 12px 30px rgba(0,0,0,.25);

    opacity:0;

    pointer-events:none;

    transition:.3s;

    z-index:9999;

}

.backTop.show{

    opacity:1;

    pointer-events:auto;

}

.backTop:hover{

    transform:translateY(-4px);

}
/* MEMBER ADMINISTRATION AND SAFE DELETION REVIEW */

.adl-member-cell{
    display:flex;
    align-items:center;
    gap:10px;
    min-width:210px;
}

.adl-passport-sm{
    width:48px;
    height:48px;
    border-radius:12px;
    object-fit:cover;
    border:2px solid #e2e8f0;
    background:#f1f5f9;
}

.adl-passport-sm:hover{
    border-color:var(--primary);
}

.btn.warning{
    background:linear-gradient(135deg,var(--warning),#d97706);
}

.deletion-review{
    max-width:980px;
    margin:0 auto;
}

.deletion-member-summary{
    display:flex;
    align-items:center;
    gap:18px;
}

.deletion-member-summary .adl-passport-sm{
    width:72px;
    height:72px;
    border-radius:18px;
}

.deletion-reasons{
    margin:14px 0 0;
    padding-left:22px;
}

.deletion-reasons li{
    margin:8px 0;
    line-height:1.55;
}

.deletion-confirmation{
    border:1px solid #fecaca;
    background:#fff7f7;
}

.deletion-confirmation label{
    color:#7f1d1d;
}

.deletion-checkbox{
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin:12px 0 18px;
    color:#7f1d1d;
    font-weight:800;
}

.deletion-checkbox input{
    width:auto;
    margin:3px 0 0;
}

@media(max-width:700px){
    .deletion-member-summary{
        align-items:flex-start;
    }

    .deletion-review .grid.two{
        grid-template-columns:1fr;
    }
}

/* ==============================================================
   MEMBER ADMIN TABLE - RESPONSIVE, CACHE-SAFE PRESENTATION
   ============================================================== */

.card.table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
}

.member-admin-table{
    width:100%;
    min-width:2050px;
    table-layout:auto;
}

.member-admin-table th,
.member-admin-table td{
    vertical-align:middle;
}

.member-admin-table th:first-child,
.member-admin-table td:first-child{
    min-width:280px;
}

.member-admin-table .adl-member-cell{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:250px;
}

.member-admin-table .adl-member-cell > a{
    display:block;
    flex:0 0 48px;
    width:48px;
    height:48px;
    overflow:hidden;
    border-radius:12px;
}

.member-admin-table .adl-passport-sm{
    display:block!important;
    width:48px!important;
    min-width:48px!important;
    max-width:48px!important;
    height:48px!important;
    min-height:48px!important;
    max-height:48px!important;
    object-fit:cover!important;
    object-position:center!important;
    border-radius:12px!important;
}

.member-admin-table .member-actions{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:8px;
    min-width:330px;
}

.member-admin-table .member-actions > *{
    flex:0 0 auto;
    margin:0;
}

.member-admin-table .member-actions form{
    display:inline-flex;
}

.member-admin-table .member-actions .btn{
    width:auto;
    white-space:nowrap;
}

@media(max-width:700px){
    .member-admin-table{
        min-width:1900px;
    }

    .member-admin-table .member-actions .btn{
        width:auto;
    }
}
/* ==============================================================
   ADL RESPONSIVE OPERATIONS LAYER 2026-10
   Presentation only: no routes, forms, controllers or business rules.
   Browser viewport automatically selects desktop/tablet/mobile layout.
   ============================================================== */

.v3-topbar-left{display:flex;align-items:center;gap:12px;min-width:0}
.v3-mobile-brand{display:none;align-items:center;gap:9px;min-width:0}
.v3-mobile-brand img{width:38px;height:38px;object-fit:contain;background:#fff;border-radius:9px;padding:2px}
.v3-mobile-brand strong,.v3-mobile-brand span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v3-mobile-brand strong{font-size:13px;color:#0f4c81;line-height:1.1}
.v3-mobile-brand span{font-size:11px;color:#64748b;max-width:145px;margin-top:2px}
.v3-user-name{font-weight:800;color:#334155;font-size:13px}

/* Desktop remains the primary full-width working surface. */
@media (min-width:1001px){
    body{overflow-x:hidden}
    .v3-content{width:100%;max-width:none;margin:0;padding:28px}
}

/* Tablet / phone: navigation becomes an off-canvas drawer automatically. */
@media (max-width:1000px){
    html,body{max-width:100%;overflow-x:hidden}
    body{padding-bottom:68px}
    .v3-topbar{height:62px;padding:0 12px;gap:8px}
    .v3-desktop-title{display:none}
    .v3-mobile-brand{display:flex}
    .mobile-toggle{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;padding:0;flex:0 0 42px}
    .v3-user-name{display:none}
    .v3-avatar{width:36px;height:36px}
    .v3-content{width:100%;max-width:none;padding:14px;margin:0}
    .v3-sidebar{box-shadow:18px 0 45px rgba(15,23,42,.25)}
    .v3-sidebar .v3-menu a{min-height:46px}
    .table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
    table{max-width:none}
    input,select,textarea{font-size:16px} /* prevents iOS input zoom */
}

/* Phone operations dashboard: dense enough to work, large enough to tap. */
@media (max-width:700px){
    .hero,.portal-hero,.page-head{padding:18px;border-radius:20px;margin-bottom:14px}
    .hero .eyebrow,.portal-hero .eyebrow,.page-head .eyebrow{margin-bottom:8px;padding:5px 10px;font-size:11px}
    .hero h1,.portal-hero h1,.page-head h1{font-size:22px;line-height:1.15}
    .hero p,.portal-hero p,.page-head p{font-size:13px;line-height:1.35;margin-top:7px}

    .grid{gap:10px}
    .grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}
    .grid.four.mt{margin-top:10px}
    .grid.three,.grid.two{grid-template-columns:1fr}
    .card{padding:14px;border-radius:16px}
    .metric{min-height:92px}
    .metric::after{width:64px;height:64px;right:-20px;top:-20px}
    .metric span{font-size:12px;margin-bottom:6px;line-height:1.2;padding-right:14px}
    .metric b{font-size:20px;line-height:1.15;overflow-wrap:anywhere}
    .metric small{font-size:11px!important;line-height:1.25}

    .section-title{font-size:18px;margin:20px 0 10px}
    .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
    .action-tile,.quick-action{min-height:54px;padding:12px 9px;border-radius:16px;justify-content:center;text-align:center;font-size:13px;line-height:1.2}

    .form-grid{grid-template-columns:1fr}
    .btn{min-height:44px}
    .card .btn{width:auto;max-width:100%}
    .member-admin-table .member-actions .btn{width:auto}
    .backTop{width:44px;height:44px;right:12px;bottom:78px}
}

@media (max-width:360px){
    .v3-content{padding:10px}
    .grid.four{gap:8px}
    .card{padding:12px}
    .metric b{font-size:18px}
    .quick-actions{gap:8px}
    .v3-mobile-brand span{max-width:105px}
}
