* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
 
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}
 
/* Login */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}
 
.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    width: 320px;
    text-align: center;
}
 
.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--primary, #0f766e);
}
 
.subtitle {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
 
.login-box label {
    display: block;
    text-align: left;
    font-size: 0.85rem;
    margin: 0.75rem 0 0.25rem;
}
 
.login-box input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.95rem;
}
 
.login-box button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.6rem;
    background: var(--primary, #0f766e);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
 
.login-box button:hover {
    opacity: 0.9;
}
 
.alert {
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}
 
.alert-error {
    background: #fee2e2;
    color: #991b1b;
}
 
/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary, #0f766e);
    color: #fff;
    padding: 1rem 1.5rem;
}
 
.topbar h1 {
    font-size: 1.2rem;
}
 
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}
 
.btn-link {
    color: #fff;
    text-decoration: underline;
}
 
/* Cards */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
}
 
.card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    min-width: 180px;
    flex: 1;
}
 
.card h3 {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}
 
.card-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary, #0f766e);
}
 
/* Nav links */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
}
 
.nav-links a {
    background: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary, #0f766e);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    font-size: 0.9rem;
}
 
.nav-links a:hover {
    background: var(--primary, #0f766e);
    color: #fff;
}
 
/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin: 0 1.5rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
 
.data-table th, .data-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}
 
.data-table th {
    background: #f9fafb;
    color: #6b7280;
}
 
h2 {
    padding: 0 1.5rem;
    margin: 1rem 0;
    font-size: 1.1rem;
}
 
.notice {
    padding: 0.75rem 1.5rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.85rem;
}
 
/* Topbar left/right layout */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
 
.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.85;
}
 
.back-link:hover { opacity: 1; }
 
/* Page body */
.page-body {
    padding: 1.5rem;
}
 
/* Buttons */
.btn-primary {
    background: var(--primary, #0f766e);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-block;
}
 
.btn-primary:hover { opacity: 0.9; }
 
.btn-secondary {
    background: #e5e7eb;
    color: #374151;
    padding: 0.5rem 1.1rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-block;
}
 
.btn-secondary:hover { background: #d1d5db; }
 
.btn-danger-link {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
}
 
.btn-danger-link:hover { color: #991b1b; }
 
/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
 
.badge-active      { background: #dcfce7; color: #166534; }
.badge-inactive    { background: #fee2e2; color: #991b1b; }
.badge-vacant      { background: #fef9c3; color: #854d0e; }
.badge-not-yet-due { background: #e0f2fe; color: #075985; }
 
/* Table actions */
.actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}
 
.actions a { color: var(--primary, #0f766e); text-decoration: none; }
.actions a:hover { text-decoration: underline; }
.actions form { margin: 0; }
 
/* Data table override for page-body */
.page-body .data-table {
    margin: 0 0 1.5rem 0;
    width: 100%;
}
 
/* Forms */
.form-card {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    max-width: 680px;
}
 
.form-group {
    margin-bottom: 1.1rem;
}
 
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: #374151;
}
 
.required { color: #dc2626; }
 
.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.95rem;
    background: #fff;
}
 
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary, #0f766e);
    box-shadow: 0 0 0 2px rgba(15,118,110,0.15);
}
 
.form-row {
    display: flex;
    gap: 1rem;
}
 
.form-row .form-group { flex: 1; }
 
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
 
.field-hint {
    color: #6b7280;
    font-size: 0.78rem;
    display: block;
    margin-top: 0.25rem;
}
 
/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}
 
.empty-state p { margin-bottom: 1rem; }
 
/* Household detail */
.detail-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    margin-bottom: 1.5rem;
    max-width: 600px;
}
 
.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}
 
.detail-row:last-child { border-bottom: none; }
 
.detail-label {
    width: 160px;
    color: #6b7280;
    flex-shrink: 0;
}
 
.detail-value { color: #111827; }
 
/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
 
.section-header h2 {
    padding: 0;
    margin: 0;
}
 
/* Members grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
 
.member-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
 
.member-photo img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}
 
.photo-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, #0f766e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 600;
}
 
.member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
}
 
.member-info strong { font-size: 0.95rem; color: #111827; }
.member-rel, .member-phone { color: #6b7280; }
 
.member-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-end;
    font-size: 0.8rem;
}
 
.member-actions a { color: var(--primary, #0f766e); text-decoration: none; }
.member-actions a:hover { text-decoration: underline; }
.member-actions form { margin: 0; }
 
/* Photo preview on edit */
.current-photo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
 
.current-photo img {
    border-radius: 50%;
    object-fit: cover;
}
 
/* Alert success */
.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
 
/* Section links */
.section-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}
 
/* Reports grid */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
 
.report-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    text-decoration: none;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.15s;
}
 
.report-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-left: 3px solid var(--primary, #0f766e);
}
 
.report-icon {
    font-size: 1.75rem;
    width: 48px;
    text-align: center;
}
 
.report-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--primary, #0f766e);
}
 
.report-info p {
    font-size: 0.82rem;
    color: #6b7280;
}
 
/* WhatsApp link */
.whatsapp-link {
    color: #16a34a;
    text-decoration: none;
    font-size: 0.85rem;
}
 
.whatsapp-link:hover {
    text-decoration: underline;
}
 
/* Search bar */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
}
 
.search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
}
 
.search-input:focus {
    outline: none;
    border-color: var(--primary, #0f766e);
    box-shadow: 0 0 0 2px rgba(15,118,110,0.15);
}
 
/* Directory list */
.directory-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
 
.directory-row {
    background: #fff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
}
 
.directory-row:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.10);
    border-left: 3px solid var(--primary, #0f766e);
}
 
.directory-info {
    flex: 1;
}
 
.directory-house {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
 
.house-badge {
    background: var(--primary, #0f766e);
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}
 
.directory-name {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}
 
.directory-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #6b7280;
}
 
.directory-photo {
    margin-left: 1rem;
    flex-shrink: 0;
}
 
.directory-photo img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}
 
/* Info alert */
.alert-info {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
    border-left: 3px solid #3b82f6;
}
 
/* Email link button */
.btn-email-link {
    background: none;
    border: none;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    text-decoration: underline;
}
 
.btn-email-link:hover {
    color: #1e3a8a;
}
 
/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}
 
.filter-bar select,
.filter-bar input[type="date"] {
    padding: 0.45rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 0.9rem;
    background: #fff;
}
 
/* Summary bar */
.summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0fdf9;
    border: 1px solid #d1fae5;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #065f46;
}
 
.summary-total {
    font-weight: 600;
}