/* ═══════════════════════════════════════════════════════════
   MHA Properties — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
    --navy:         #0f2044;
    --navy-mid:     #1a3460;
    --navy-light:   #e8edf5;
    --accent:       #1d4ed8;
    --accent-hover: #1e40af;
    --accent-light: #dbeafe;

    --white:        #ffffff;
    --bg:           #f4f6fa;
    --bg-card:      #ffffff;
    --border:       #e2e8f0;
    --border-dark:  #cbd5e1;

    --text:         #0f172a;
    --text-mid:     #334155;
    --text-muted:   #64748b;
    --text-faint:   #94a3b8;

    --success-bg:   #dcfce7;
    --success-text: #15803d;
    --warn-bg:      #fef9c3;
    --warn-text:    #a16207;
    --danger-bg:    #fee2e2;
    --danger-text:  #dc2626;

    --topbar-h:     60px;
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    16px;
    --shadow-sm:    0 1px 3px rgba(15,32,68,.08);
    --shadow:       0 4px 16px rgba(15,32,68,.10);
    --shadow-lg:    0 8px 32px rgba(15,32,68,.14);

    --font:         'Jost', sans-serif;
    --max-w:        1200px;
    --transition:   0.18s ease;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ── App shell ──────────────────────────────────────────── */
.mha-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Navigation Bar ─────────────────────────────────── */
.mha-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--topbar-h);
    background: var(--navy);
    box-shadow: 0 2px 12px rgba(15,32,68,.25);
}

.mha-topbar__inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

/* Logo */
.mha-topbar__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.mha-topbar__logo img { height: 32px; width: auto; }
.mha-topbar__wordmark {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -.2px;
    white-space: nowrap;
}
.mha-topbar__wordmark-accent {
    color: #ff5001;
    font-weight: 700;
}
.mha-topbar__home-icon {
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    transition: transform .15s;
}
.mha-topbar__logo:hover .mha-topbar__home-icon {
    transform: scale(1.15);
}

/* Nav links */
.mha-topbar__nav {
    flex: 1 1 auto;
    min-width: 0;
    /* No overflow clipping — dropdown must be able to escape vertically.
       Overflow handling is done via the More dropdown + responsive show/hide. */
}

ul.mha-nav {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .15rem;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

.mha-nav__item { flex-shrink: 0; }

.mha-nav__item a,
ul.mha-nav li a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .55rem;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.mha-nav__item a:hover,
ul.mha-nav li a:hover,
ul.mha-nav li.current-menu-item a {
    background: rgba(255,255,255,.12);
    color: #fff;
}
ul.mha-nav li.current-menu-item a {
    background: rgba(96,165,250,.18);
    color: #93c5fd;
}

/* Bold standalone link style — for high-priority quick-access items like Incidents */
.mha-nav__link--bold {
    font-weight: 700 !important;
    color: #fff !important;
    background: rgba(220,38,38,.18) !important;
    border: 1px solid rgba(220,38,38,.35) !important;
    padding: .4rem .75rem !important;
}
.mha-nav__link--bold:hover {
    background: rgba(220,38,38,.32) !important;
    border-color: rgba(220,38,38,.55) !important;
    color: #fff !important;
}
.mha-nav__link--bold.is-active {
    background: rgba(220,38,38,.4) !important;
    border-color: rgba(220,38,38,.7) !important;
}

/* "More" overflow dropdown */
.mha-nav__more {
    position: relative;
}
.mha-nav__more-btn {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .35rem .55rem;
    border: 0;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}
.mha-nav__more-btn:hover,
.mha-nav__more-btn[aria-expanded="true"] {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.mha-nav__more-btn.is-active {
    background: rgba(96,165,250,.18);
    color: #93c5fd;
}
.mha-nav__more-btn svg {
    transition: transform .15s ease;
}
.mha-nav__more-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.mha-nav__more-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #1e3a8a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(15,32,68,.45);
    list-style: none;
    margin: 0;
    padding: .35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 1100;
}
.mha-nav__more.is-open .mha-nav__more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mha-nav__more-menu li { margin: 0; }
.mha-nav__more-menu a {
    display: block;
    padding: .55rem .75rem;
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}
.mha-nav__more-menu a:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.mha-nav__more-sep {
    height: 1px;
    background: rgba(255,255,255,.12);
    margin: .35rem .35rem;
    display: none; /* Hidden when dropdown only contains the always-in-More items */
}
/* Show separator only when at least one priority item has folded into More */
@media (max-width: 1500px) {
    .mha-nav__more-sep { display: block; }
}

/* Priority-based responsive collapse:
   Items with `.show-prio-N` inside the dropdown are hidden by default;
   they appear only when the matching main-nav `.mha-nav__item--prio-N`
   is hidden by its breakpoint media query. */
.mha-nav__more-menu li.show-prio-2,
.mha-nav__more-menu li.show-prio-3,
.mha-nav__more-menu li.show-prio-4 { display: none; }

/* Breakpoint 1: hide priority-2 items (GL Codes) below 1500px */
@media (max-width: 1500px) {
    .mha-nav__item--prio-2 { display: none; }
    .mha-nav__more-menu li.show-prio-2 { display: list-item; }
}

/* Breakpoint 2: hide priority-3 items (Incident Reports) below 1300px */
@media (max-width: 1300px) {
    .mha-nav__item--prio-3 { display: none; }
    .mha-nav__more-menu li.show-prio-3 { display: list-item; }
}

/* Breakpoint 3: hide priority-4 items (Properties, Property Staff) below 1150px */
@media (max-width: 1150px) {
    .mha-nav__item--prio-4 { display: none; }
    .mha-nav__more-menu li.show-prio-4 { display: list-item; }
}

/* User area */
.mha-topbar__user {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
    margin-left: auto;
}
.mha-topbar__user-name {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: rgba(255,255,255,.8);
    font-weight: 500;
}
.mha-topbar__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}
.mha-topbar__logout {
    font-size: .8rem;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    padding: .3rem .7rem;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.mha-topbar__logout:hover {
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
    border-color: rgba(255,255,255,.3);
}

/* Mobile toggle */
.mha-topbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    margin-left: auto;
}
.mha-topbar__toggle span {
    display: block;
    height: 2px;
    background: rgba(255,255,255,.8);
    border-radius: 2px;
    transition: all var(--transition);
}
.mha-topbar__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mha-topbar__toggle.is-open span:nth-child(2) { opacity: 0; }
.mha-topbar__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mha-mobile-nav {
    display: none;
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    z-index: 999;
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    background: var(--navy-mid);
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 4px 16px rgba(15,32,68,.25);
}
.mha-mobile-nav.is-open { display: block; }
.mha-mobile-nav__list { list-style: none; }
.mha-mobile-nav__list li a {
    display: block;
    padding: .65rem .5rem;
    color: rgba(255,255,255,.8);
    font-size: .95rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-decoration: none;
}
.mha-mobile-nav__list li a:hover { color: #fff; }
.mha-mobile-nav__logout {
    display: inline-block;
    margin-top: 1rem;
    font-size: .85rem;
    color: rgba(255,255,255,.5);
    text-decoration: none;
}

/* ── Main content area ──────────────────────────────────── */
.mha-main {
    flex: 1;
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: calc(var(--topbar-h) + 2rem);
}

/* ── Page layout ────────────────────────────────────────── */
.mha-page__header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.mha-page__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -.3px;
}
.mha-page__subtitle {
    margin-top: .4rem;
    color: var(--text-muted);
    font-size: 1rem;
}
.mha-page__content {}
.mha-page--centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Dashboard ──────────────────────────────────────────── */
.mha-dashboard {}

.mha-dashboard__welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 2rem 2.25rem;
    background: var(--navy);
    border-radius: var(--radius-lg);
    background-image: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.mha-dashboard__welcome::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(96,165,250,.08);
    pointer-events: none;
}
.mha-dashboard__greeting {
    font-size: .95rem;
    font-weight: 400;
    color: rgba(255,255,255,.6);
    margin-bottom: .1rem;
}
.mha-dashboard__name {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.5px;
}
.mha-dashboard__role {
    font-size: .78rem;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: .2rem;
}
.mha-dashboard__date {
    font-size: .85rem;
    color: rgba(255,255,255,.5);
    font-weight: 400;
}

/* Tool cards grid */
.mha-dashboard__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.mha-tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
    position: relative;
}
a.mha-tool-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--text);
}
.mha-tool-card--soon {
    opacity: .6;
    cursor: default;
    pointer-events: none;
}
.mha-tool-card__icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-light);
    border-radius: var(--radius);
}
.mha-tool-card__body { flex: 1; min-width: 0; }
.mha-tool-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: .2rem;
}
.mha-tool-card__desc {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.mha-tool-card__arrow {
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition);
    flex-shrink: 0;
}
a.mha-tool-card:hover .mha-tool-card__arrow {
    opacity: 1;
    transform: translateX(0);
}
.mha-tool-card__badge {
    position: absolute;
    top: .75rem;
    right: .75rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--border);
    color: var(--text-muted);
    padding: .2rem .55rem;
    border-radius: 20px;
}

/* ── Cards ──────────────────────────────────────────────── */
.mha-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.mha-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Buttons ────────────────────────────────────────────── */
.mha-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.mha-btn--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.mha-btn--primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}
.mha-btn--secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.mha-btn--secondary:hover {
    background: var(--accent-light);
}

/* ── Article / page content ─────────────────────────────── */
.mha-article__body {
    line-height: 1.75;
    color: var(--text-mid);
}
.mha-article__body h1,
.mha-article__body h2,
.mha-article__body h3 {
    color: var(--navy);
    font-weight: 700;
    margin: 1.5em 0 .5em;
}
.mha-article__body p { margin-bottom: 1em; }
.mha-article__body ul,
.mha-article__body ol { margin: .75em 0 .75em 1.5em; }

/* ── Footer ─────────────────────────────────────────────── */
.mha-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background: var(--white);
}
.mha-footer__inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .8rem;
    color: var(--text-faint);
}

/* ── 404 error page ─────────────────────────────────────── */
.mha-error {
    text-align: center;
    padding: 4rem 1rem;
}
.mha-error__code {
    font-size: 6rem;
    font-weight: 700;
    color: var(--border-dark);
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: .5rem;
}
.mha-error__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: .5rem;
}
.mha-error__desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ── WordPress login page overrides ────────────────────── */
body.login {
    background: var(--bg);
    font-family: var(--font) !important;
}
body.login #login h1 a {
    background-image: none !important;
    font-family: var(--font);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    text-indent: 0;
    width: auto;
    height: auto;
}
body.login #loginform,
body.login #lostpasswordform {
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    padding: 2rem !important;
}
body.login .button-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    border-radius: var(--radius-sm) !important;
    font-family: var(--font) !important;
    font-weight: 600 !important;
    font-size: .95rem !important;
    height: auto !important;
    padding: .6rem 1.5rem !important;
    transition: background var(--transition) !important;
}
body.login .button-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}
body.login input[type="text"],
body.login input[type="password"] {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    font-family: var(--font) !important;
    font-size: .95rem !important;
    padding: .55rem .8rem !important;
    height: auto !important;
    transition: border-color var(--transition) !important;
}
body.login input[type="text"]:focus,
body.login input[type="password"]:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(29,78,216,.12) !important;
}

/* ── Utility classes ────────────────────────────────────── */
.u-text-muted  { color: var(--text-muted); }
.u-text-center { text-align: center; }
.u-mt-1        { margin-top: .5rem; }
.u-mt-2        { margin-top: 1rem; }
.u-mt-3        { margin-top: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────── */

/* Tighter screens — hide non-essential parts of nav to prevent overlap */
@media (max-width: 1500px) {
    /* Hide chevron icons on megamenu buttons */
    .mha-nav__megamenu-btn svg { display: none; }
}

@media (max-width: 1300px) {
    /* Hide category text labels — keep only the icons */
    .mha-nav__megamenu-btn > span:not(.mha-nav__megamenu-icon) { display: none; }
    .mha-nav__megamenu-icon { font-size: 1.1rem; }
    .mha-nav__megamenu-btn { padding: .4rem .55rem; }
    /* Keep Incidents label visible — it's the priority quick-access item */
    .mha-nav__item--incident .mha-nav__link--bold { font-size: .8rem; padding: .35rem .65rem !important; }
}

/* Hide username text on cramped screens to free space for nav items;
   avatar still shows, so identity is still visible */
@media (max-width: 1400px) {
    .mha-topbar__user-name {
        font-size: 0;        /* hide name */
        gap: 0;
    }
    .mha-topbar__user-name .mha-topbar__avatar {
        font-size: .8rem;    /* re-show avatar letter (overrides above) */
    }
}

@media (max-width: 768px) {
    .mha-topbar__nav,
    .mha-topbar__user { display: none; }
    .mha-topbar__toggle { display: flex; }

    .mha-dashboard__welcome {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
    }
    .mha-dashboard__name { font-size: 1.6rem; }
    .mha-dashboard__grid { grid-template-columns: 1fr; }

    .mha-main { padding: calc(var(--topbar-h) + 1.25rem) 1rem 1.25rem; }
    .mha-footer__inner { flex-direction: column; text-align: center; gap: .25rem; }
}

@media (max-width: 480px) {
    .mha-tool-card { flex-wrap: wrap; }
}

/* ── Page load animation ────────────────────────────────── */
@keyframes mha-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mha-dashboard__welcome,
.mha-tool-card,
.mha-page__header,
.mha-card {
    animation: mha-fade-up .35s ease both;
}
.mha-tool-card:nth-child(1) { animation-delay: .05s; }
.mha-tool-card:nth-child(2) { animation-delay: .10s; }
.mha-tool-card:nth-child(3) { animation-delay: .15s; }
.mha-tool-card:nth-child(4) { animation-delay: .20s; }

/* ── Toasts (Resident360 forms page) ─────────────────────────────
 * Replaces window.alert() — slides up from bottom, auto-dismisses.
 * Pairs with r360ShowToast() in resident360-app.php inline JS. */
.r360-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #16a34a;
    color: #fff;
    padding: .85rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15,32,68,.2);
    font-family: 'Jost', -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 460px;
    text-align: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.r360-toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.r360-toast--error {
    background: #b91c1c;
}
@media (max-width: 600px) {
    .r360-toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
        transform: translateY(20px);
    }
    .r360-toast.is-visible { transform: translateY(0); }
}

/* ───────────────────────────────────────────────────────────────────────
   Global baseline for unstyled page content (v9.48.2)

   Pages whose content is stored as WordPress pages (Resident Records,
   parts of the Resident360 sub-routes, etc.) render raw HTML without
   theme-specific classes. Before this baseline they appeared completely
   unstyled — naked browser form fields, default buttons, plain headings,
   no card backgrounds. This block gives any plain HTML inside .mha-main
   a sensible themed look so DB-stored content fits the rest of the site.

   Scoped to .mha-main so it doesn't bleed into the topbar, footer, or
   the resident360-app.php embed (which has its own .r360-embed scope
   and gets explicit reset rules below).
   ─────────────────────────────────────────────────────────────────── */

/* ── Headings inside page content ─────────────────────────────────── */
.mha-main h1:not([class]),
.mha-main h2:not([class]) {
    font-family: var(--font);
    color: var(--navy);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 0.5em;
}
.mha-main h1:not([class]) { font-size: 1.875rem; }
.mha-main h2:not([class]) { font-size: 1.4rem; }
.mha-main h3:not([class]),
.mha-main h4:not([class]) {
    font-family: var(--font);
    color: var(--navy);
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5em 0 0.5em;
}
.mha-main h3:not([class]) { font-size: 1.15rem; }
.mha-main h4:not([class]) { font-size: 1rem; }

.mha-main p:not([class]) {
    color: var(--text-mid);
    line-height: 1.7;
    margin: 0 0 1em;
}

/* ── Form inputs — themed defaults ────────────────────────────────── */
.mha-main input:not([class]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.mha-main select:not([class]),
.mha-main textarea:not([class]) {
    font-family: var(--font);
    font-size: 0.95rem;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.4;
    box-sizing: border-box;
    max-width: 100%;
}
.mha-main input:not([class]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):focus,
.mha-main select:not([class]):focus,
.mha-main textarea:not([class]):focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}
.mha-main input:not([class])::placeholder,
.mha-main textarea:not([class])::placeholder {
    color: var(--text-faint);
}

/* Labels in plain forms (typically inline 'Field Name:' text + input) */
.mha-main label:not([class]) {
    display: inline-block;
    color: var(--text-mid);
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.5rem;
    line-height: 1.6;
}

/* ── Buttons — themed defaults ────────────────────────────────────── */
.mha-main button:not([class]):not([type="submit"]):not([disabled]),
.mha-main input[type="submit"]:not([class]),
.mha-main input[type="button"]:not([class]),
.mha-main button[type="button"]:not([class]) {
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-dark);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.mha-main button:not([class]):not([disabled]):hover,
.mha-main input[type="submit"]:not([class]):hover,
.mha-main input[type="button"]:not([class]):hover,
.mha-main button[type="button"]:not([class]):hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* Submit buttons get the primary treatment by default — they're the
   call-to-action on most forms. */
.mha-main button[type="submit"]:not([class]),
.mha-main input[type="submit"]:not([class]) {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
    font-weight: 600;
}
.mha-main button[type="submit"]:not([class]):hover,
.mha-main input[type="submit"]:not([class]):hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--white);
}

/* ── Links inside page content ────────────────────────────────────── */
.mha-main a:not([class]) {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition);
}
.mha-main a:not([class]):hover {
    border-bottom-color: var(--accent);
}

/* ── Tables ───────────────────────────────────────────────────────── */
.mha-main table:not([class]) {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 1em 0;
}
.mha-main table:not([class]) th {
    background: var(--bg);
    padding: 0.75rem 1rem;
    text-align: left;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.mha-main table:not([class]) td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
    font-size: 0.95rem;
}
.mha-main table:not([class]) tr:last-child td { border-bottom: none; }
.mha-main table:not([class]) tr:hover td { background: var(--bg); }

/* Note: we intentionally do NOT add a generic .mha-main > div card
   treatment here. That would card-treat structural divs throughout the
   site and bleed into Resident360's layout. Form/input/button styling
   is what was actually missing — that's what these rules provide. */
