:root{--p:#1d4ed8;--pd:#1e40af;--bg:#f4f7fb;--surface:#fff;--text:#172033;--muted:#667085;--border:#dce3ed;--danger:#b42318;--success:#067647}*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial,sans-serif;color:var(--text);background:var(--bg)}a{text-decoration:none;color:inherit}.topbar{min-height:68px;padding:0 5%;display:flex;align-items:center;justify-content:space-between;background:#102a43;color:#fff}.topbar nav{display:flex;align-items:center;gap:18px}.brand{font-size:20px;font-weight:750}.container{width:min(1180px,92%);margin:36px auto}.narrow{width:min(900px,92%)}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}h1{margin:0 0 8px;font-size:30px}h2{margin:0 0 18px;font-size:20px}.muted{color:var(--muted);margin:0}.eyebrow{color:var(--p);font-weight:700;margin:0 0 6px}.btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 16px;border:1px solid transparent;border-radius:8px;cursor:pointer;font-weight:650}.primary{background:var(--p);color:#fff}.primary:hover{background:var(--pd)}.secondary{background:#fff;border-color:var(--border)}.light{background:#ffffff1f;color:#fff}.block{width:100%;margin-top:18px}.link-button{border:0;background:none;color:#fff;cursor:pointer;font:inherit}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 24px #102a430f}.table-wrap{overflow-x:auto}table{width:100%;border-collapse:collapse}th,td{padding:14px 16px;border-bottom:1px solid var(--border);text-align:left}th{font-size:13px;color:var(--muted);background:#f8fafc}.table-link{color:var(--p);font-weight:650;margin-right:12px}.form-card{padding:28px}.form-card h2:not(:first-child){margin-top:30px;padding-top:26px;border-top:1px solid var(--border)}.grid,.details-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.field{display:flex;flex-direction:column;gap:7px}.full{grid-column:1/-1}label{font-weight:650;font-size:14px}input,select,textarea{width:100%;border:1px solid #cbd5e1;border-radius:8px;padding:11px 12px;font:inherit;background:#fff}input:focus,select:focus,textarea:focus{outline:3px solid #1d4ed81f;border-color:var(--p)}small{min-height:16px;color:var(--danger);font-size:12px}.actions{margin-top:28px;display:flex;justify-content:flex-end;gap:10px}.details{padding:26px;margin-bottom:20px}.details-grid div{display:flex;flex-direction:column;gap:6px}.details-grid span{color:var(--muted);font-size:13px}.details-grid strong{white-space:pre-wrap}.alert{padding:12px 14px;border-radius:8px;margin-bottom:18px}.success{background:#ecfdf3;color:var(--success)}.error{background:#fef3f2;color:var(--danger)}.empty{padding:60px 24px;text-align:center;background:#fff;border:1px dashed #b9c5d4;border-radius:12px}.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(145deg,#102a43,#1d4ed8)}.login-card{width:min(410px,92%);padding:34px;border-radius:16px;background:#fff;box-shadow:0 20px 55px #0004}.login-card h1,.login-card>.muted,.demo{text-align:center}.login-card>.muted{margin-bottom:24px}.login-card label{display:block;margin:14px 0 7px}.brand-mark{width:58px;height:58px;display:grid;place-items:center;margin:0 auto 18px;border-radius:14px;background:var(--p);color:#fff;font-size:21px;font-weight:800}.demo{color:var(--muted);font-size:13px;margin:20px 0 0}@media(max-width:720px){.topbar{padding:14px 4%;align-items:flex-start}.topbar nav{gap:10px;flex-wrap:wrap;justify-content:flex-end}.page-heading{align-items:flex-start;flex-direction:column}.grid,.details-grid{grid-template-columns:1fr}.full{grid-column:auto}.form-card{padding:20px}}
.button-group{display:flex;gap:10px;flex-wrap:wrap}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.section-heading h2{margin:0}.summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px}.compact-summary{grid-template-columns:repeat(3,1fr)}.summary-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px;box-shadow:0 5px 16px #102a430d;display:flex;flex-direction:column;gap:8px}.summary-card span{font-size:13px;color:var(--muted)}.summary-card strong{font-size:22px}.due-card strong{color:var(--danger)}.status-pill{width:max-content;font-size:14px!important;padding:6px 10px;border-radius:999px;background:#e8f0ff;color:var(--pd)}.accounting-details{margin-bottom:22px}.payment-table{border:1px solid var(--border);border-radius:8px}.no-payments{padding-top:8px}.calculation-note{margin:18px 0 0;padding:12px;background:#f8fafc;border-radius:8px;color:var(--muted);font-size:13px}@media(max-width:850px){.summary-grid,.compact-summary{grid-template-columns:1fr 1fr}}@media(max-width:560px){.summary-grid,.compact-summary{grid-template-columns:1fr}.section-heading{align-items:flex-start;flex-direction:column}}

/* Phase 3 - mobile-number customer search */
.search-card{padding:24px;margin-bottom:28px}.mobile-search-form{display:flex;align-items:flex-end;gap:12px}.search-input-field{width:min(420px,100%)}.search-button{flex:0 0 auto}.search-help{margin:10px 0 0;color:var(--muted);font-size:13px}.search-error{margin:16px 0 0}.search-results-heading{margin-top:6px}.table-subtext{display:block;margin-top:4px;color:var(--muted);font-size:12px}.due-text{color:var(--danger);font-weight:700}.search-actions{min-width:190px}.search-actions .table-link{display:inline-block;margin-bottom:5px}@media(max-width:720px){.mobile-search-form{align-items:stretch;flex-direction:column}.search-button{width:100%}}

/* Phase 4 - business dashboard */
.dashboard-heading{margin-bottom:28px}.dashboard-card-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:32px}.metric-card{min-height:150px;padding:22px;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:0 8px 24px #102a430f;display:flex;flex-direction:column;gap:9px}.metric-card span{font-size:14px;color:var(--muted);font-weight:650}.metric-card strong{font-size:29px;line-height:1.15}.metric-card small{margin-top:auto;color:var(--muted);font-size:12px}.received-metric strong{color:var(--success)}.due-metric strong{color:var(--danger)}.expected-metric strong{color:#9a6700}.dashboard-section{margin:0 0 30px}.dashboard-section>.section-heading{margin-bottom:14px}.dashboard-section>.section-heading p{margin-top:5px}.dashboard-two-column{display:grid;grid-template-columns:1fr 1fr;gap:22px}.compact-empty{padding:28px 18px}.compact-empty h3{margin:0 0 8px}.activity-list{overflow:hidden}.activity-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border-bottom:1px solid var(--border);transition:background .15s ease}.activity-row:last-child{border-bottom:0}.activity-row:hover{background:#f8fafc}.activity-row>div{display:flex;flex-direction:column;gap:5px}.activity-row span{font-size:12px;color:var(--muted)}.activity-meta{text-align:right;align-items:flex-end}.activity-meta strong{font-size:13px}.payment-amount strong{font-size:16px;color:var(--success)}@media(max-width:980px){.dashboard-card-grid{grid-template-columns:repeat(2,1fr)}.dashboard-two-column{grid-template-columns:1fr}}@media(max-width:560px){.dashboard-card-grid{grid-template-columns:1fr}.metric-card{min-height:135px}.activity-row{align-items:flex-start}.dashboard-heading .button-group{width:100%}.dashboard-heading .button-group .btn{flex:1}}

.member-note{margin-bottom:16px}.member-card{border:1px solid var(--border);border-radius:10px;padding:18px;margin:14px 0;background:#f8fafc}.member-card-header,.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.btn-danger-small{min-height:32px;padding:5px 10px;background:#fff1f1;color:#b42318;border-color:#fecaca}.count-badge{background:#edf2f7;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}.inner-table{box-shadow:none}.link-button-blue{color:var(--primary)}


/* Production registration/access enhancements */
.registration-type-grid,
.payment-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 12px;
}

.type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    cursor: pointer;
}

.type-option input {
    width: auto;
    margin-top: 3px;
}

.type-option span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.type-option small,
.today-note span {
    color: var(--muted);
}

.recovery-alert {
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.recovery-alert > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.member-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    margin: 14px 0;
    background: #f8fafc;
}

.member-card-header,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.btn-danger-small {
    background: #fff;
    border-color: #fecaca;
    color: #b42318;
    min-height: 34px;
    padding: 6px 10px;
}

.today-note {
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 16px 0;
}

.link-button-dark {
    color: var(--primary);
    padding: 0;
}

@media (max-width: 720px) {
    .registration-type-grid,
    .payment-type-grid {
        grid-template-columns: 1fr;
    }
    .recovery-alert,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Security, monitoring and cache hardening */
.login-links{display:flex;justify-content:center;gap:10px;margin-top:20px;font-size:13px;color:var(--p)}.login-links a{font-weight:650}.password-help{color:var(--muted);font-size:12px;margin:8px 0}.health-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:30px}.health-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:8px;box-shadow:0 5px 16px #102a430d}.health-card span{font-size:13px;color:var(--muted)}.health-card strong{font-size:20px}.health-up{color:var(--success)}.health-down{color:var(--danger)}@media(max-width:980px){.health-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:560px){.health-grid{grid-template-columns:1fr}}

/* Phase 7 dashboard and billing */
.dashboard-filter-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.dashboard-filter-form {
    max-width: 420px;
}
.dashboard-filter-form .field {
    margin: 0;
}
.inline-price-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.received-text {
    font-weight: 700;
}
