/* ========================================================
   EBENEZER APARTMENTS — DESIGN SYSTEM
   Canvas White + Touch of Blue (All Writings in Black)
   ======================================================== */

:root {
    --bg-primary: #FFFFFF;
    --bg-canvas: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F1F5F9;
    --border-hairline: #E2E8F0;
    --border-dark: #0A0A0A;
    --text-primary: #0A0A0A;         /* All writings strictly black */
    --text-muted: #1F2937;           /* High-contrast readable black */
    --text-light: #374151;           /* Crisp dark black-grey */
    --accent-blue: #1D4ED8;          /* Touch of blue */
    --accent-blue-hover: #1E40AF;
    --accent-blue-subtle: #EFF6FF;
    --accent-blue-border: #93C5FD;
    --btn-bg: #1D4ED8;
    --btn-text: #FFFFFF;
    --btn-hover: #1E40AF;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --radius-none: 0px;
    --radius-sm: 4px;
    --radius-pill: 9999px;
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Header & Navigation */
.app-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-hairline);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-svg {
    stroke: var(--text-primary);
    display: block;
}

.brand-text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 0;
    text-decoration: none;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
}

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

/* Layout Containers */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-hairline);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stat & Summary Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.stat-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards & Surfaces */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* House Selector Tabs */
.house-selector-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-hairline);
    padding-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.house-tab-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    min-height: 42px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.house-tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.house-tab-btn.active {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--btn-bg);
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--btn-hover);
    color: var(--btn-text);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
}

.btn-outline:hover {
    background: var(--text-primary);
    color: #FFFFFF;
}

.btn-subtle {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-hairline);
}

.btn-subtle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-lg {
    min-height: 50px;
    padding: 14px 26px;
    font-size: 15px;
    font-weight: 700;
}

.btn-sm {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 12px;
}

.btn-copy {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
}

.btn-block {
    width: 100%;
}

/* Toggle Pill Buttons */
.pill-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    border: 1px solid var(--border-hairline);
    background: var(--bg-surface);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.pill-btn {
    border: none;
    background: transparent;
    min-height: 34px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.pill-btn.active {
    background: var(--btn-bg);
    color: var(--btn-text);
}

/* Strict Monochrome Badges */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    line-height: 1;
}

.badge-solid {
    background: #0A0A0A;
    color: #FFFFFF;
    border: 1px solid #0A0A0A;
}

.badge-outline {
    background: transparent;
    color: #0A0A0A;
    border: 1px solid #0A0A0A;
}

.badge-dashed {
    background: transparent;
    color: #666666;
    border: 1px dashed #666666;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-hairline);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.table th {
    background: var(--bg-surface);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-hairline);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-hairline);
    color: var(--text-primary);
}

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

.table tbody tr:hover td {
    background: var(--bg-surface-hover);
}

.table-mono {
    font-family: var(--font-mono);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--text-primary);
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Password Visibility Toggle */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrap .form-input {
    padding-right: 48px;
}

.password-toggle-btn {
    position: absolute;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.password-toggle-btn .icon-eye-off {
    display: none;
}

.password-toggle-btn.is-visible .icon-eye {
    display: none;
}

.password-toggle-btn.is-visible .icon-eye-off {
    display: block;
}

/* Banner & Alerts */
.alert {
    padding: 14px 18px;
    border: 1px solid var(--text-primary);
    background: var(--bg-surface);
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-dashed {
    border-style: dashed;
}

.alert-mono {
    font-family: var(--font-mono);
}

/* Centered Authentication Card */
.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-canvas);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-hairline);
    border-top: 3px solid var(--accent-blue);
    background: var(--bg-surface);
    padding: 36px 32px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo .brand-text {
    margin-top: 12px;
    font-size: 15px;
}

.auth-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.auth-forgot-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
}

/* Modal Windows — Screen Centered & Compact Boxed Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-top: 3px solid var(--accent-blue);
    width: 100%;
    max-width: 480px;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #0A0A0A;
    margin: 0;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: #0A0A0A;
}

/* Payment Type Tabs / Segmented Buttons */
.modal-pay-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 6px;
    margin-top: 4px;
}

.modal-pay-types .pay-category-btn {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    line-height: 1.2;
}

.modal-pay-types .pay-category-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #0A0A0A;
}

.modal-pay-types .pay-category-btn.active {
    background: #0A0A0A;
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(10, 10, 10, 0.15);
}

/* Pay Advance Target Buttons */
.advance-target-btns {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 12px;
}

.advance-target-btn {
    flex: 1;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.advance-target-btn:hover {
    border-color: #0A0A0A;
}

.advance-target-btn.active {
    background: #0A0A0A;
    color: #FFFFFF;
    border-color: #0A0A0A;
}

/* Pay Advance Compact Box */
.advance-months-container {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.advance-calc-box {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 10px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: #0A0A0A;
}

/* Utility Classes */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Grid 2 Columns */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Spacious Portal Section Divisions (Inspired by Portal Structure: Canvas White + Touch of Blue + Strict Black Text) */
.portal-section {
    background: #FFFFFF;
    border: 1px solid var(--border-hairline);
    border-top: 3px solid var(--accent-blue);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    margin-bottom: 24px;
}

.portal-section-banner {
    background: #F8FAFC;
    border-bottom: 1px solid var(--border-hairline);
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-section-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #0A0A0A; /* Strictly Black */
    margin: 0;
}

.portal-section-body {
    padding: 24px;
    background: #FFFFFF;
}

.portal-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-hairline);
    flex-wrap: wrap;
    gap: 8px;
}

/* Basic Information & Tenancy Card (Inspired by Portal Structure, No Profile Photo) */
.basic-info-card {
    background: #FFFFFF;
    border: 1px solid var(--border-hairline);
    border-top: 3px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    padding: 0;
    overflow: hidden;
    margin-bottom: 24px;
}

.basic-info-card .info-card-header {
    background: var(--bg-canvas);
    padding: 13px 20px;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.basic-info-card .info-card-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0A0A0A; /* Strictly Black */
    margin: 0;
}

.basic-info-card .info-card-body {
    padding: 20px 22px;
}

.basic-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px 22px;
}

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

.info-item .info-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0A0A0A; /* Strictly Black */
}

.info-item .info-value {
    font-size: 14px;
    font-weight: 700;
    color: #0A0A0A; /* Strictly Black */
}

/* Hero Balance Banner (Canvas White + Touch of Blue + Strict Black Text) */
.hero-balance-card {
    background: #FFFFFF;
    color: #0A0A0A;
    border: 1px solid var(--border-hairline);
    border-top: 3px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.hero-balance-card .hero-label {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #0A0A0A; /* Strictly Black */
    margin-bottom: 6px;
    font-weight: 700;
}

.hero-balance-card .hero-amount {
    font-size: 32px;
    font-family: var(--font-mono);
    font-weight: 800;
    line-height: 1.1;
    color: #0A0A0A; /* Strictly Black */
}

.hero-balance-card .hero-subtext {
    font-size: 12px;
    color: #0A0A0A; /* Strictly Black */
    margin-top: 6px;
}

.hero-balance-card .hero-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hero-balance-card .btn-hero-primary {
    background: var(--accent-blue);
    color: #FFFFFF;
    border: 1px solid var(--accent-blue);
    font-weight: 700;
    padding: 11px 22px;
}

.hero-balance-card .btn-hero-primary:hover {
    background: var(--accent-blue-hover);
    border-color: var(--accent-blue-hover);
    color: #FFFFFF;
}

.hero-balance-card .btn-hero-outline {
    background: transparent;
    color: #0A0A0A;
    border: 1px solid #0A0A0A;
    padding: 11px 20px;
    font-weight: 600;
}

.hero-balance-card .btn-hero-outline:hover {
    background: #F1F5F9;
    color: #0A0A0A;
}

/* Statement Card & Quick Pay Bar (Canvas White + Touch of Blue) */
.statement-card {
    background: #FFFFFF;
    border: 1px solid var(--border-hairline);
    border-top: 3px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    padding: 24px;
    margin-bottom: 24px;
}

.statement-card .statement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-hairline);
}

.statement-card .statement-title {
    font-size: 16px;
    font-weight: 700;
    color: #0A0A0A; /* Strictly Black */
    margin: 0;
}

.statement-card .statement-actions-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--border-hairline);
    flex-wrap: wrap;
}

.statement-card .statement-actions-bar .actions-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0A0A0A; /* Strictly Black */
    margin-right: 6px;
}

/* Secondary Navigation Strip */
.secondary-nav-strip {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-hairline);
    flex-wrap: wrap;
}

.secondary-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.secondary-nav-pill:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    text-decoration: none;
}

/* Smooth Surface Tenant Dashboard Grid Layout */
.smooth-surface-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 0 36px;
}

.tenant-welcome-header {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-hairline);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.tenant-welcome-title {
    margin: 0 0 6px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tenant-welcome-kicker {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.3;
    letter-spacing: 0;
}

.tenant-welcome-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.tenant-welcome-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.tenant-welcome-balance {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--bg-canvas);
    border: 1px solid var(--border-hairline);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
}

.tenant-welcome-balance-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.tenant-welcome-balance-value {
    font-size: 17px;
    color: var(--text-primary);
}

.tenant-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

.tenant-detail-grid > .portal-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.tenant-detail-grid > .portal-section > .portal-section-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Tenant Bills Structured Grid */
.tenant-bills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.bill-card {
    background: #FFFFFF;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-sm, 6px);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.bill-card:hover {
    border-color: #0A0A0A;
}

.bill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.bill-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #0A0A0A;
    line-height: 1.35;
}

.bill-card-amount {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: #0A0A0A;
    line-height: 1.15;
    margin: 6px 0 4px 0;
}

.bill-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.bill-card-meta strong {
    color: #0A0A0A;
}

.electricity-portal-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 1.6fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .electricity-portal-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Premium Receipts & Payment History Styling */
.receipt-row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: #FFFFFF;
    border: 1px solid var(--border-hairline);
    border-left: 4px solid var(--accent-blue);
    border-radius: var(--radius-sm, 6px);
    flex-wrap: wrap;
    gap: 16px;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.receipt-row-item:hover {
    background-color: var(--bg-canvas);
    border-color: #CBD5E1;
    border-left-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.receipt-row-main {
    flex: 1;
    min-width: 260px;
}

.receipt-row-primary {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.receipt-amount-display {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    padding-right: 18px;
    border-right: 1px solid var(--border-hairline);
}

.receipt-amount-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.receipt-amount-value {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    color: #0A0A0A;
    line-height: 1.2;
}

.receipt-purpose-block {
    flex: 1;
    min-width: 200px;
}

.receipt-purpose-title {
    font-size: 15px;
    font-weight: 800;
    color: #0A0A0A;
    margin-bottom: 6px;
    line-height: 1.3;
}

.receipt-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

.receipt-meta-grid strong {
    color: #0A0A0A;
}

@media (max-width: 640px) {
    .receipt-amount-display {
        border-right: none;
        padding-right: 0;
        padding-bottom: 10px;
        border-bottom: 1px dashed var(--border-hairline);
        width: 100%;
    }
    .receipt-row-action {
        width: 100%;
    }
    .receipt-row-action .btn {
        width: 100%;
        justify-content: center;
    }
}

.smooth-pay-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--border-hairline);
}

.smooth-pay-actions .btn {
    min-height: 50px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
}

.kplc-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: start;
}

.modal-pay-types {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-pay-types .btn {
    flex: 1 1 110px;
    min-height: 44px;
}

/* Desktop defaults for mobile drawer & hamburger */
.hamburger-btn {
    display: none;
}

.mobile-primary-nav {
    display: none;
}

.mobile-nav-drawer {
    display: none;
}

.mobile-drawer-backdrop {
    display: none;
}

/* Tablet & Small-Laptop Header Collapse (prevents 8-link nav overflow) */
@media (max-width: 1080px) {
    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        position: relative;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .nav-links, .header-actions {
        display: none !important;
    }

    .mobile-primary-nav {
        display: flex;
        align-items: center;
        gap: 10px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-primary-nav .nav-link {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-primary);
        padding: 8px 10px;
    }

    .mobile-primary-nav .nav-link.active {
        text-decoration: underline;
    }

    .mobile-primary-nav .nav-link.active::after {
        display: none;
    }

    /* Morphing Hamburger Button that folds into an X — Positioned on the Left */
    .hamburger-btn {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: 1px solid var(--border-hairline);
        border-radius: var(--radius-sm);
        cursor: pointer;
        padding: 8px;
        margin: 0;
        transition: border-color 0.2s ease, background 0.2s ease;
        flex-shrink: 0;
    }

    .hamburger-btn:hover {
        border-color: var(--text-primary);
        background: var(--bg-surface-hover);
    }

    .hamburger-btn .bar {
        display: block;
        width: 20px;
        height: 2px;
        background: #0A0A0A;
        margin: 2.5px 0;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
        transform-origin: center;
    }

    /* Folds into an 'X' */
    .hamburger-btn.is-active .bar-1 {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger-btn.is-active .bar-2 {
        opacity: 0;
        transform: scale(0.2);
    }

    .hamburger-btn.is-active .bar-3 {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Mobile Drawer Backdrop */
    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 1998;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .mobile-drawer-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Off-Canvas Side Drawer: Slides from Left to Right */
    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        background: #FFFFFF;
        border-right: 2px solid #0A0A0A;
        display: flex;
        flex-direction: column;
        box-shadow: 10px 0 36px rgba(0, 0, 0, 0.18);
        z-index: 1999;
        transform: translateX(-100%); /* Hidden to the left */
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }

    .mobile-nav-drawer.active {
        transform: translateX(0); /* Draws to the right! */
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 18px;
        border-bottom: 1px solid var(--border-hairline);
        background: var(--bg-surface);
        flex-shrink: 0;
    }

    .drawer-close-btn {
        background: transparent;
        border: 1px solid var(--border-hairline);
        border-radius: var(--radius-sm);
        font-size: 22px;
        line-height: 1;
        width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--text-primary);
        transition: all 0.15s ease;
    }

    .drawer-close-btn:hover {
        background: #0A0A0A;
        color: #FFFFFF;
        border-color: #0A0A0A;
    }

    .mobile-drawer-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-drawer-body a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 14px;
        font-weight: 600;
        color: var(--text-primary);
        border-radius: var(--radius-sm);
        text-decoration: none;
        transition: all 0.15s ease;
    }

    .mobile-drawer-body a:hover,
    .mobile-drawer-body a.active {
        background: #0A0A0A;
        color: #FFFFFF;
        padding-left: 14px;
    }

    .mobile-drawer-divider {
        height: 1px;
        background: var(--border-hairline);
        margin: 8px 0;
    }

    .mobile-drawer-footer {
        padding: 14px 18px;
        border-top: 1px solid var(--border-hairline);
        background: var(--bg-surface);
        flex-shrink: 0;
    }
}

/* Tablet & Single-Column Dashboard Stacking */
@media (max-width: 900px) {
    .tenant-detail-grid,
    .kplc-two-col {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .brand-text {
        font-size: 13px;
        letter-spacing: 1px;
    }

    /* Prevent iOS Safari auto-zoom & ensure comfortable touch targets */
    .form-input, .form-select, .form-textarea {
        font-size: 16px;
        min-height: 46px;
        padding: 11px 14px;
    }

    .btn {
        min-height: 46px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .btn-sm {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-copy {
        min-height: 36px;
        padding: 6px 12px;
    }

    .pill-btn {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 13px;
    }

    .auth-wrapper {
        padding: 18px 14px;
    }

    .auth-card {
        padding: 26px 20px;
    }

    /* Clean Mobile Content Flow */
    .main-wrapper {
        padding: 16px 12px 48px;
        max-width: 100%;
    }

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

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-label {
        font-size: 10px;
        margin-bottom: 4px;
        letter-spacing: 0.2px;
    }

    .stat-value {
        font-size: 17px;
    }

    .stat-subtext {
        font-size: 10px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

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

    .card {
        padding: 16px 12px;
        margin-bottom: 16px;
    }

    .card-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 14px;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th, .table td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    .modal-content {
        padding: 20px 16px;
        width: 95%;
        max-width: 480px;
        margin: auto;
    }

    .modal-pay-types {
        grid-template-columns: repeat(2, 1fr);
    }

    footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 16px 12px;
    }

    /* Basic Information Card Mobile */
    .basic-info-card .info-card-header {
        padding: 12px 14px;
    }

    .basic-info-card .info-card-body {
        padding: 16px 14px;
    }

    .basic-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 12px;
    }

    /* Hero Balance Card Mobile */
    .hero-balance-card {
        padding: 20px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .hero-balance-card .hero-amount {
        font-size: 26px;
    }

    .hero-balance-card .hero-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .hero-balance-card .hero-actions .btn,
    .hero-balance-card .hero-actions a.btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Statement Card & Quick Pay Bar Mobile */
    .statement-card {
        padding: 16px 12px;
        margin-bottom: 16px;
    }

    .statement-card .statement-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .statement-card .statement-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .statement-card .statement-actions-bar .actions-label {
        margin-bottom: 4px;
    }

    .statement-card .statement-actions-bar .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    /* Secondary Nav Strip Mobile */
    .secondary-nav-strip {
        flex-direction: column;
        gap: 8px;
    }

    .secondary-nav-pill {
        width: 100%;
        justify-content: space-between;
    }

    /* Portal Section Divisions Mobile */
    .portal-section-banner {
        padding: 12px 16px !important;
    }

    .portal-section-body {
        padding: 18px 16px !important;
    }

    /* Smooth Surface Dashboard Mobile */
    .tenant-welcome-name {
        font-size: 18px;
    }

    .tenant-welcome-balance {
        width: 100%;
        justify-content: space-between;
    }

    .tenant-bills-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .smooth-pay-actions {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .smooth-pay-actions .btn {
        width: 100% !important;
        text-align: center;
        justify-content: center;
    }
}

/* Narrow Phone Adaptation (<= 420px) */
@media (max-width: 420px) {
    .stat-grid,
    .basic-info-grid {
        grid-template-columns: 1fr;
    }

}

/* ========================================================
   PRINT STYLESHEET (B&W Printable Receipts & Statements)
   ======================================================== */
@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .app-header, .no-print, .btn, .modal-overlay, .house-selector-tabs, .alert {
        display: none !important;
    }

    .main-wrapper {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .printable-document {
        border: 2px solid #000000 !important;
        padding: 24px !important;
        background: #FFFFFF !important;
    }

    .table th {
        background: #F0F0F0 !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }

    .table td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
    }

    .badge {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        background: transparent !important;
    }
}
