* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f4f9f7;
    color: #103b2f;
    min-height: 100vh;
}
a { color: inherit; }

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 24px 56px;
}

/* ---------------- Top bar ---------------- */
.er-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #dcece4;
    position: sticky;
    top: 0;
    z-index: 500;
}
.er-logo {
    font-size: 22px;
    font-weight: 800;
    color: #0b6e4f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.er-logo span {
    font-weight: 400;
    color: #6b8f82;
    font-size: 13px;
}
.er-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------------- Buttons ---------------- */
.btn {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.btn-primary { background: #0b6e4f; color: #fff; box-shadow: 0 4px 14px rgba(11, 110, 79, 0.25); }
.btn-primary:hover:not(:disabled) { background: #095c42; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: #d99a26; color: #fff; }
.btn-gold:hover:not(:disabled) { background: #c08a20; }
.btn-outline { background: #fff; border: 1px solid #cfe3da; color: #0b6e4f; }
.btn-outline:hover { background: #eef8f3; }
.btn-ghost { background: transparent; color: #4a6e62; border: none; }
.btn-ghost:hover { color: #0b6e4f; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ---------------- Role badge & user menu ---------------- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.role-badge.tenant { background: #e6f4ea; color: #0b6e4f; }
.role-badge.landlord { background: #fdf1dd; color: #a1650f; }
.role-badge.admin { background: #eef2ff; color: #4338ca; }
.role-badge.lfe { background: #fee2e2; color: #b91c1c; }

.user-menu {
    position: relative;
}
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f9f7;
    border: 1px solid #dcece4;
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #103b2f;
}
.user-menu-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0b6e4f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #dcece4;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(16, 59, 47, 0.14);
    min-width: 220px;
    padding: 8px;
    z-index: 600;
}
.user-menu-dropdown.show { display: block; }
.user-menu-dropdown .info { padding: 8px 10px 10px; border-bottom: 1px solid #eef2ef; margin-bottom: 6px; }
.user-menu-dropdown .info .name { font-weight: 700; font-size: 13px; }
.user-menu-dropdown .info .email { font-size: 12px; color: #6b8f82; word-break: break-all; }
.user-menu-dropdown button {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #103b2f;
}
.user-menu-dropdown button:hover { background: #f4f9f7; }

/* ---------------- Public hero ---------------- */
.er-hero {
    background: linear-gradient(135deg, #0b6e4f 0%, #0e8a63 60%, #10a172 100%);
    color: #fff;
    border-radius: 24px;
    padding: 48px 40px;
    margin: 24px 0 32px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
}
.er-hero h1 { font-size: 34px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.er-hero p { font-size: 15px; opacity: 0.92; margin-bottom: 20px; line-height: 1.6; }
.er-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.er-hero-actions .btn-outline { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); color: #fff; }
.er-hero-actions .btn-outline:hover { background: rgba(255,255,255,0.2); }
.er-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.er-hero-stat { background: rgba(255,255,255,0.12); border-radius: 16px; padding: 16px; }
.er-hero-stat .num { font-size: 26px; font-weight: 800; }
.er-hero-stat .lbl { font-size: 11px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.3px; }

.role-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.role-card {
    background: #fff;
    border: 1px solid #dcece4;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.role-card:hover { border-color: #0b6e4f; box-shadow: 0 10px 24px rgba(11,110,79,0.1); }
.role-card .icon { font-size: 28px; margin-bottom: 10px; }
.role-card h3 { font-size: 15px; margin-bottom: 6px; }
.role-card p { font-size: 12px; color: #6b8f82; line-height: 1.5; }

/* ---------------- Workspace nav ---------------- */
.workspace-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid #dcece4;
    padding-bottom: 12px;
}
.workspace-tab {
    background: #fff;
    border: 1px solid #dcece4;
    color: #4a6e62;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.workspace-tab.active { background: #0b6e4f; border-color: #0b6e4f; color: #fff; }
.workspace-tab:hover:not(.active) { background: #eef8f3; }

.workspace-panel { display: none; animation: erFadeIn 0.25s ease; }
.workspace-panel.show { display: block; }
@keyframes erFadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }

/* ---------------- Cards / grid / tables ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #dcece4; border-radius: 14px; padding: 16px 18px; }
.stat-card .label { font-size: 11px; color: #6b8f82; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-card .value { font-size: 24px; font-weight: 800; color: #103b2f; margin-top: 4px; }
.stat-card .value.green { color: #0b6e4f; }
.stat-card .value.gold { color: #d99a26; }
.stat-card .value.red { color: #dc2626; }

.card { background: #fff; border: 1px solid #dcece4; border-radius: 18px; padding: 20px 22px 24px; margin-bottom: 18px; }
.card-title { font-size: 14px; font-weight: 700; color: #103b2f; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-sub { font-size: 12px; color: #6b8f82; margin: -8px 0 14px; }

.data-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.data-table th { text-align: left; color: #6b8f82; font-weight: 600; padding: 8px 8px 8px 0; border-bottom: 1px solid #e5efe9; font-size: 11px; text-transform: uppercase; }
.data-table td { padding: 10px 8px 10px 0; border-bottom: 1px solid #eef4f1; }
.empty-row { color: #94a89f; font-size: 13px; padding: 16px 0; text-align: center; }

.status-pill { padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; display: inline-block; }
.status-pill.available, .status-pill.open, .status-pill.approved, .status-pill.approve { background: #e6f4ea; color: #0b6e4f; }
.status-pill.pending, .status-pill.proposed, .status-pill.under_review { background: #fdf1dd; color: #a1650f; }
.status-pill.declined, .status-pill.rejected, .status-pill.closed { background: #fde2e2; color: #b91c1c; }
.status-pill.resolved, .status-pill.accepted, .status-pill.leased { background: #e0edff; color: #1d4ed8; }

.grade-chip { display: inline-flex; width: 24px; height: 24px; border-radius: 6px; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.grade-chip.A { background: #dcfce7; color: #15803d; }
.grade-chip.B { background: #fef9c3; color: #a16207; }
.grade-chip.C { background: #fde68a; color: #92400e; }
.grade-chip.D { background: #fecaca; color: #b91c1c; }

.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; justify-content: flex-end; }
.hidden { display: none !important; }
.mt-2 { margin-top: 12px; }
.field-hint { font-size: 12px; color: #6b8f82; margin-top: -8px; margin-bottom: 12px; }

.lfe-modal-body, .lfe-modal-auth .lfe-modal-body {
    max-height: min(72vh, 640px);
    overflow-y: auto;
}

.er-app-footer { margin-top: 28px; padding-top: 16px; border-top: 1px solid #dcece4; font-size: 11px; color: #6b8f82; text-align: center; line-height: 1.6; }

@media (max-width: 800px) {
    .er-hero { grid-template-columns: 1fr; padding: 32px 24px; }
    .er-topbar { padding: 12px 16px; }
}
