@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --admin-font: 'Inter', 'Poppins', Arial, sans-serif;
    --display-font: 'Inter', 'Poppins', Arial, sans-serif;
    --sidebar-width: 292px;
    --page-x: 38px;
    --topbar-height: 74px;
    --hero-radius: 22px;
    --card-radius: 22px;
    --ink: #171412;
    --muted: #837a73;
    --paper: #fffdfb;
    --warm: #ebe6df;
    --soft: #fff1ea;
    --line: #e6ded7;
    --line-strong: #d8ccc3;
    --accent: #c84f18;
    --accent-dark: #973511;
    --danger: #c23136;
    --green: #278565;
    --gold: #b88b13;
    --navy: #080d1d;
    --navy-soft: #12182c;
    --chart-blue: #0f8ccf;
    --chart-teal: #168c79;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    min-height: 100%;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body { margin: 0; padding: 0; min-height: 100vh; min-height: 100svh; background: var(--warm); color: var(--ink); font-family: var(--admin-font); overflow-x: hidden; }
a { color: inherit; }

.app-shell {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background:
        linear-gradient(135deg, rgba(15,140,207,.08), transparent 30%),
        linear-gradient(160deg, #eef4f8 0%, #ebe6df 44%, #faf7f2 100%);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 20px 18px;
    color: #fff;
    background:
        radial-gradient(circle at 92% 12%, rgba(207,85,28,.45) 0 126px, transparent 128px),
        linear-gradient(165deg, var(--navy) 0%, #12111b 42%, #27140f 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.08);
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(255,255,255,.28); }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand-mark { width: 56px; height: 56px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #df6731, #15a085); color: #fff; font-size: 17px; font-weight: 900; letter-spacing: 0; box-shadow: 0 18px 34px rgba(21,160,133,.22); }
.brand strong { display: block; font-family: var(--display-font); font-size: 21px; line-height: 1.12; letter-spacing: 0; }
.brand span { display: block; margin-top: 5px; color: rgba(255,255,255,.68); font-size: 13px; font-weight: 600; }
.nav-section-label { margin: 0 0 14px 14px; color: #8795b4; font-size: 12px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; }
.side-nav { display: grid; gap: 10px; padding-bottom: 18px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 13px; min-height: 58px; padding: 0 16px; border-radius: 17px; color: #d7dfef; text-decoration: none; font-size: 16px; font-weight: 800; letter-spacing: 0; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.nav-link.active { background: #fff; color: #101828; box-shadow: 0 16px 30px rgba(0,0,0,.18); }
.nav-link.active::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 28px; border-radius: 99px; background: linear-gradient(#df6731, #15a085); transform: translateY(-50%); }
.nav-icon { width: 28px; text-align: center; font-size: 19px; line-height: 1; filter: saturate(.9); }
.sidebar-footer { margin-top: auto; display: grid; gap: 12px; padding-top: 18px; }
.sidebar-user-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.08); padding: 13px; }
.sidebar-user-card .avatar { width: 42px; height: 42px; background: rgba(21,160,133,.18); color: #7df0d9; }
.sidebar-user-card strong,
.sidebar-user-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-card strong { font-size: 14px; }
.sidebar-user-card small { margin-top: 3px; color: rgba(255,255,255,.58); font-size: 12px; }
.logout-button { width: 100%; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(255,255,255,.08); color: #fff; padding: 13px 16px; font-weight: 900; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.logout-button:hover { border-color: rgba(223,103,49,.5); background: rgba(223,103,49,.18); }
.topbar-logout-form {
    margin: 0;
}

.topbar-logout {
    width: auto;
    min-height: 44px;
    border-color: rgba(200,79,24,.2);
    background: #fff3ec;
    color: var(--accent-dark);
    padding: 0 17px;
    box-shadow: 0 10px 22px rgba(200, 79, 24, .1);
}

.topbar-logout:hover {
    border-color: rgba(200,79,24,.38);
    background: var(--accent);
    color: #fff;
}

.main { min-width: 0; }
.topbar { min-height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px var(--page-x) 0; padding: 0 26px; background: rgba(255,255,255,.92); border: 1px solid rgba(230,222,215,.9); border-radius: 22px; box-shadow: 0 18px 46px rgba(20, 24, 35, .1); backdrop-filter: blur(18px); }
.search-mini { flex: 1; max-width: 560px; min-height: 48px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 0 17px; color: #8190a8; box-shadow: inset 0 1px 0 rgba(255,255,255,.85); }
.search-mini input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; background: transparent; }
.user-chip { display: flex; align-items: center; gap: 12px; font-weight: 900; white-space: nowrap; color: #0b1020; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--accent); }
.content-wrap { width: 100%; max-width: none; margin: 0; padding: 28px var(--page-x) 46px; }

.hero-panel { position: relative; overflow: hidden; border-radius: var(--hero-radius); padding: 30px 34px; color: #fff; background: linear-gradient(120deg, #141311, #2a1810); margin-bottom: 24px; box-shadow: 0 22px 50px rgba(34, 16, 9, .2); }
.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 46%, rgba(255,255,255,.075) 46.4% 52%, transparent 52.4%),
        radial-gradient(circle at 88% 18%, rgba(207,85,28,.34) 0 110px, transparent 112px);
    pointer-events: none;
}
.hero-panel > * {
    position: relative;
    z-index: 1;
}
.dashboard-hero {
    min-height: 318px;
    display: grid;
    align-items: center;
    border: 1px solid rgba(255,255,255,.08);
    background:
        linear-gradient(135deg, rgba(21,160,133,.14), transparent 35%),
        linear-gradient(120deg, #070a15 0%, #17110f 48%, #32170c 100%);
}
.hero-panel.red { background: radial-gradient(circle at 86% 22%, rgba(255,255,255,.16) 0 130px, transparent 132px), linear-gradient(120deg, #90191a, #da352e); }
.hero-panel.orange { background: radial-gradient(circle at 86% 22%, rgba(255,255,255,.14) 0 130px, transparent 132px), linear-gradient(120deg, #cb4b14, #ed742f); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.kicker { display: inline-flex; gap: 10px; align-items: center; border-radius: 999px; background: rgba(255,255,255,.12); padding: 8px 15px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: #51d494; box-shadow: 0 0 0 5px rgba(81,212,148,.16); }
.app-title { margin: 16px 0 12px; font-family: var(--display-font); font-size: 64px; line-height: .98; letter-spacing: 0; }
.muted { color: var(--muted); }
.hero-panel .muted { color: rgba(255,255,255,.62); }
.hero-brand-card {
    width: 190px;
    min-height: 210px;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 28px;
    background: rgba(255,255,255,.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 24px 48px rgba(0,0,0,.22);
    padding: 24px;
    text-align: center;
}
.hero-brand-card span { color: #fff; font-size: 35px; font-weight: 900; letter-spacing: 1px; }
.hero-brand-card strong { color: #ffcfb9; font-size: 20px; }
.hero-brand-card small { color: rgba(255,255,255,.62); font-size: 13px; font-weight: 700; }
.flat-pill { display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent); color: #fff; padding: 11px 22px; font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.stat-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.stat-pill { border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.12); padding: 15px 18px; min-width: 154px; color: rgba(255,255,255,.82); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.stat-pill strong { display: block; margin-bottom: 4px; font-size: 26px; line-height: 1; }
.green { color: #51d494; } .pink { color: #ff8493; } .gold { color: var(--gold); } .teal { color: var(--green); } .redtext { color: var(--danger); }

.dashboard-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 4px 0 16px;
}

.dashboard-section-head h2 {
    margin: 0;
    color: #071027;
    font-family: var(--display-font);
    font-size: 30px;
    line-height: 1.08;
}

.dashboard-section-head > span {
    border: 1px solid #d7e5ef;
    border-radius: 999px;
    background: rgba(255,255,255,.64);
    color: #567087;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 900;
}

.dashboard-section-head.compact {
    margin-top: 30px;
}

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 30px; }
.card, .module-card, .notice-list, .resident-row, .payment-row, .emergency-tile, .matrix-card, .contact-card { border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--paper); box-shadow: 0 10px 28px rgba(63, 51, 43, .08); }
.module-card { position: relative; min-height: 148px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; text-decoration: none; color: #625b55; font-size: 16px; font-weight: 800; letter-spacing: 0; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.module-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(200,79,24,.08), transparent 48%, rgba(21,160,133,.08)); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.module-card.active, .module-card:hover { border-color: rgba(200,79,24,.26); background: #fff; color: var(--accent-dark); box-shadow: 0 22px 44px rgba(55, 35, 24, .12); transform: translateY(-3px); }
.module-card:hover::before { opacity: 1; }
.module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.module-label { display: block; margin-top: 14px; color: #293142; font-size: 18px; font-weight: 900; }
.module-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, #fff2eb, #eef8f5); font-size: 27px; letter-spacing: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.module-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #f5f8fb; color: #7a8799; font-size: 24px; line-height: 1; transition: background .2s ease, color .2s ease; }
.module-card:hover .module-arrow { background: var(--accent); color: #fff; }
.dashboard-analytics {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, .75fr);
    gap: 18px;
    margin: 4px 0 28px;
}

.analytics-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,253,251,.9)),
        #fff;
    padding: 24px;
    box-shadow: 0 20px 44px rgba(20, 24, 35, .09);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.analytics-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 92% 8%, rgba(15,140,207,.08), transparent 34%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}

.analytics-card:hover {
    border-color: rgba(15,140,207,.18);
    box-shadow: 0 26px 58px rgba(20, 24, 35, .13);
    transform: translateY(-2px);
}

.analytics-card:hover::before {
    opacity: 1;
}

.analytics-card > * {
    position: relative;
    z-index: 1;
}

.analytics-card-wide {
    grid-row: span 2;
}

.analytics-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.analytics-head h2 {
    margin: 0 0 5px;
    color: #071027;
    font-family: var(--display-font);
    font-size: 22px;
    line-height: 1.15;
}

.analytics-head p {
    color: #63718a;
    font-size: 14px;
    font-weight: 700;
}

.trend-badge {
    border-radius: 999px;
    background: #e8f8f3;
    color: #128467;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.line-chart {
    min-height: 270px;
}

.line-chart svg {
    display: block;
    width: 100%;
    min-height: 230px;
    border-bottom: 1px dashed #d9e1ec;
    background:
        linear-gradient(to bottom, transparent 0 24%, #e7edf5 24.5% 25%, transparent 25.5% 49%, #e7edf5 49.5% 50%, transparent 50.5% 74%, #e7edf5 74.5% 75%, transparent 75.5%);
}

.chart-area {
    fill: rgba(15, 140, 207, .12);
    opacity: 0;
    animation: chartAreaIn .9s ease .35s forwards;
}

.chart-line {
    fill: none;
    stroke: var(--chart-blue);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: chartLineIn 1.05s cubic-bezier(.22, 1, .36, 1) .2s forwards;
}

.chart-dot {
    fill: var(--chart-blue);
    stroke: #fff;
    stroke-width: 3;
    opacity: 0;
    transform-origin: center;
    animation: chartDotIn .36s ease-out .95s forwards;
}

.chart-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 11px;
    color: #63718a;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.donut-wrap {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.animated-pie {
    position: relative;
    width: 138px;
    height: 138px;
    display: grid;
    place-items: center;
}

.animated-pie.compact {
    width: 116px;
    height: 116px;
}

.animated-pie svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(0 14px 20px rgba(20, 24, 35, .12));
}

.pie-track,
.pie-segment {
    fill: none;
    stroke-width: 18;
}

.pie-track {
    stroke: #edf2f7;
}

.pie-segment {
    stroke-linecap: round;
    transition: stroke-dasharray 1s cubic-bezier(.22, 1, .36, 1);
}

.animated-pie span {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #071027;
    font-size: 25px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(20, 24, 35, .08);
    transform: translate(-50%, -50%);
}

.animated-pie.compact span {
    width: 68px;
    height: 68px;
    font-size: 20px;
}

.chart-list {
    display: grid;
    gap: 10px;
}

.chart-list div,
.bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #3d4a5f;
    font-size: 14px;
    font-weight: 800;
}

.chart-list strong,
.bar-meta strong {
    color: #071027;
}

.legend-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--gold);
}

.legend-dot.green { background: #2aa67a; }
.legend-dot.pink { background: #d94d70; }
.legend-dot.gold { background: #c08a13; }

.bar-chart {
    display: grid;
    gap: 16px;
}

.payment-chart-layout {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.bar-row {
    display: grid;
    gap: 8px;
}

.bar-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.bar-track span {
    display: block;
    height: 100%;
    min-width: 12px;
    border-radius: inherit;
    background: var(--gold);
    transition: width .9s cubic-bezier(.22, 1, .36, 1);
}

.bar-track span.green { background: #2aa67a; }
.bar-track span.pink { background: #d94d70; }
.bar-track span.gold { background: #c08a13; }

@keyframes chartLineIn {
    to { stroke-dashoffset: 0; }
}

@keyframes chartAreaIn {
    to { opacity: 1; }
}

@keyframes chartDotIn {
    from { opacity: 0; transform: scale(.5); }
    to { opacity: 1; transform: scale(1); }
}
.insight-list {
    display: grid;
    gap: 12px;
}

.insight-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid #edf1f5;
    border-radius: 16px;
    background: #fbfcfd;
    padding: 13px 14px;
}

.insight-row strong,
.insight-row small {
    display: block;
}

.insight-row strong {
    color: #071027;
    font-size: 24px;
    line-height: 1;
}

.insight-row small {
    margin-top: 4px;
    color: #63718a;
    font-size: 12px;
    font-weight: 800;
}
.section-title { margin: 26px 0 14px; font-family: var(--display-font); font-size: 28px; line-height: 1.15; }
.notice-list { padding: 10px 24px; border-radius: 22px; background: rgba(255,255,255,.93); box-shadow: 0 20px 44px rgba(20, 24, 35, .08); }
.notice-item { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: 0; }
.soft-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #fff0e8, #eef8f5); font-size: 30px; box-shadow: inset 0 1px 0 rgba(255,255,255,.95); }
.soft-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.event-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.event-gallery img { width: 92px; height: 68px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.event-grid-panel {
    border-color: rgba(217, 204, 193, .72);
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,251,247,.94));
    padding: clamp(18px, 2vw, 26px);
}

.event-grid-toolbar {
    padding: 0 0 20px;
    border-bottom: 1px solid rgba(217, 204, 193, .72);
}

.event-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    padding-top: 22px;
}

.event-card {
    position: relative;
    display: flex;
    min-height: 318px;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    border: 1px solid rgba(217, 204, 193, .82);
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 0%, rgba(213, 76, 22, .14), transparent 35%),
        radial-gradient(circle at 0% 100%, rgba(28, 132, 109, .10), transparent 32%),
        linear-gradient(145deg, #fffefd 0%, #fbf6f0 100%);
    box-shadow: 0 18px 44px rgba(36, 21, 16, .08);
    padding: 22px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.event-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #d94f16, #159a7a, #0f2b4d);
    content: "";
    opacity: .88;
}

.event-card:hover {
    border-color: rgba(213, 76, 22, .34);
    box-shadow: 0 24px 58px rgba(36, 21, 16, .13);
    transform: translateY(-3px);
}

.event-card[data-list-row].is-hidden {
    display: none;
}

.event-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.event-icon {
    display: grid;
    width: 62px;
    height: 62px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(37, 77, 116, .95), rgba(16, 45, 79, .96));
    box-shadow: 0 14px 28px rgba(15, 43, 77, .18), inset 0 1px 0 rgba(255,255,255,.16);
    color: #fff;
    font-size: 28px;
}

.event-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-date-pill {
    display: inline-flex;
    max-width: 180px;
    flex-direction: column;
    align-items: flex-end;
    border: 1px solid rgba(213, 76, 22, .18);
    border-radius: 999px;
    background: rgba(255, 247, 241, .86);
    color: #9a3513;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .55px;
    line-height: 1.25;
    text-align: right;
    text-transform: uppercase;
}

.event-date-pill small {
    margin-top: 2px;
    color: #071027;
    font-size: 11px;
    letter-spacing: .3px;
}

.event-card-body h2 {
    margin: 0;
    color: #071027;
    font-family: var(--display-font);
    font-size: clamp(21px, 1.65vw, 27px);
    letter-spacing: 0;
    line-height: 1.08;
}

.event-card-body p {
    display: -webkit-box;
    margin-top: 10px;
    overflow: hidden;
    color: #5f6b80;
    font-size: 14px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.event-detail-list {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(217, 204, 193, .72);
}

.event-detail-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.event-detail-list span {
    color: #65728a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.event-detail-list strong {
    color: #2c2622;
    font-size: 14px;
    font-weight: 900;
    text-align: right;
}

.event-card-gallery {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    padding: 3px 0;
}

.event-card-gallery img,
.event-more-images {
    width: 50px;
    height: 50px;
    border-radius: 16px;
}

.event-card-gallery img {
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.75);
    background: #fff3ec;
    box-shadow: 0 10px 22px rgba(36, 21, 16, .10);
}

.event-more-images {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #071027, #153452);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(7, 16, 39, .18);
}

.event-empty-gallery {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    background: rgba(248, 250, 252, .9);
    color: #65728a;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
}

.event-card-actions {
    display: flex;
    justify-content: flex-end;
    margin: 2px -4px -4px;
    padding-top: 12px;
    border-top: 1px solid rgba(217, 204, 193, .58);
}

.event-card-actions .row-actions {
    width: 100%;
    gap: 10px;
    justify-content: flex-end;
}

.event-card-actions .edit-button,
.event-card-actions .danger-button {
    min-width: 78px;
    border-radius: 18px;
}

.event-empty-state {
    grid-column: 1 / -1;
}
h3 { margin: 0 0 5px; font-size: 21px; }
p { margin: 0; line-height: 1.65; }
.date { color: var(--accent-dark); font-weight: 800; letter-spacing: 1px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-family: var(--display-font); font-size: 56px; }
.search-box { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 18px 20px; font-size: 22px; color: var(--muted); margin-bottom: 18px; }
.search-box input { flex: 1; border: 0; outline: 0; font-size: 18px; background: transparent; min-width: 0; }
.chips { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 24px; }
.chip { border: 0; border-radius: 999px; background: #f7f2ef; color: #665f59; padding: 12px 20px; font-size: 15px; font-weight: 800; letter-spacing: .5px; text-decoration: none; }
.chip.active { background: #151412; color: #fff; }
.resident-row, .payment-row, .contact-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 18px; align-items: center; padding: 20px; margin-bottom: 16px; }
.edit-button, .site-button { border: 0; border-radius: 16px; background: var(--soft); color: var(--accent-dark); padding: 12px 16px; font-size: 15px; font-weight: 800; }
.matrix-card { padding: 26px; margin-bottom: 24px; }
.matrix-levels { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 20px; text-align: center; }
.level { width: 78px; height: 78px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 20px; }
.l1 { background: #dcefe8; color: #238261; } .l2 { background: #f1ecd7; color: #b28d00; } .l3 { background: #f3dadd; color: #b83742; }
.dash { width: 48px; height: 3px; background: var(--line); }
.category-grid, .emergency-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.category-card, .emergency-tile { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); padding: 20px 18px; min-height: 112px; font-size: 16px; color: #57504a; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.form-field label { display: block; margin-bottom: 8px; color: #625b55; font-size: 12px; font-weight: 900; letter-spacing: 1.8px; text-transform: uppercase; }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px; font-size: 15px; outline: 0; resize: vertical; background: #fff; color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: rgba(207,85,28,.72); background: #fffdfa; box-shadow: 0 0 0 4px rgba(207,85,28,.12); }
.form-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.form-field input[type="file"],
.inline-admin-form input[type="file"] {
    min-height: 48px;
    padding: 8px;
    color: #667085;
    background: #fff8f4;
    cursor: pointer;
}
.form-field input[type="file"]::file-selector-button,
.inline-admin-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 10px;
    background: #171412;
    color: #fff;
    padding: 10px 13px;
    font-weight: 900;
    cursor: pointer;
}
.form-field .member-select-search { margin-bottom: 10px; background: #fff8f4; }
.form-field input[type="date"],
.form-field input[type="datetime-local"],
.drawer-form input[type="date"],
.drawer-form input[type="datetime-local"] {
    color-scheme: light;
    cursor: pointer;
}
.form-field input[type="date"]::-webkit-calendar-picker-indicator,
.form-field input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.drawer-form input[type="date"]::-webkit-calendar-picker-indicator,
.drawer-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    border-radius: 10px;
    cursor: pointer;
    opacity: .68;
    padding: 5px;
}
.form-field input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-field input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.drawer-form input[type="date"]::-webkit-calendar-picker-indicator:hover,
.drawer-form input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    background: var(--soft);
    opacity: 1;
}
.member-search-hint { display: block; margin-top: 7px; color: #667085; font-size: 12px; font-weight: 800; }
.form-field.wide { grid-column: 1 / -1; }
.emergency-tile { display: flex; align-items: center; gap: 18px; background: #fdebea; color: #af3642; font-weight: 700; }
.emergency-tile.alt { background: #dcefe8; color: #2f7d66; }
.emergency-number { display: block; font-size: 25px; font-weight: 800; letter-spacing: 2px; }
.contact-card { padding: 8px 22px; }
.contact-row { border-bottom: 1px solid var(--line); margin: 0; box-shadow: none; border-radius: 0; background: transparent; }
.contact-row:last-child { border-bottom: 0; }

.inline-admin-form {
    display: grid;
    grid-template-columns: minmax(170px, .85fr) minmax(180px, 1fr) minmax(160px, 1fr) minmax(150px, .8fr) auto;
    gap: 10px;
    align-items: center;
    margin: -4px 0 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .72);
}

.inline-admin-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    padding: 12px 13px;
    outline: 0;
    font: inherit;
}

.inline-admin-form .primary-button {
    min-height: 48px;
}

/* Desktop RWA refinements */
.eyebrow-line {
    margin: 0 0 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 13px;
    font-weight: 800;
}

.module-card small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.45;
}

.directory-grid,
.payment-link-grid {
    display: grid;
    gap: 16px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .8fr);
    gap: 20px;
    align-items: start;
}

.management-grid {
    margin-bottom: 28px;
}

.panel-card {
    padding: 24px;
}

.panel-card h2,
.matrix-card h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.panel-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.panel-heading-row h2 {
    margin-bottom: 0;
}

.payment-admin-panel {
    margin-bottom: 26px;
}

.module-metrics {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.module-metrics .metric-card {
    min-height: 118px;
}

.command-wrap .section-title {
    margin-top: 30px;
    font-size: 24px;
}

.section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
}

.section-heading-row .section-title {
    margin: 0 0 14px;
}

.section-actions {
    display: flex;
    justify-content: flex-end;
    margin: -44px 0 14px;
}

.command-wrap > .card.panel-card,
.command-wrap > .matrix-card {
    margin-bottom: 24px;
}

.form-actions-row {
    display: flex;
    justify-content: flex-end;
}

.form-actions-row .primary-button {
    width: auto;
    min-width: 190px;
}

.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.mini-row strong {
    font-size: 16px;
}

.mini-row:last-child {
    border-bottom: 0;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    font-weight: 800;
}

.category-card span {
    font-size: 30px;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 22px;
    background: rgba(255,255,255,.55);
    color: var(--muted);
    padding: 28px;
    text-align: center;
    font-weight: 700;
}

.record-panel {
    overflow: visible;
    padding: 8px 22px;
}

.record-panel .notice-item,
.record-panel .contact-row,
.record-row {
    margin-bottom: 0;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.record-panel .notice-item:has(.row-actions) {
    grid-template-columns: 64px minmax(0, 1fr) minmax(160px, auto);
}

.record-panel .contact-row:has(.row-actions),
.record-row:has(.row-actions) {
    grid-template-columns: 64px minmax(0, 1fr) minmax(110px, auto) minmax(150px, auto);
}

.record-actions {
    align-self: start;
    min-width: 150px;
}

.tabs-web {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.faq-card {
    padding: 24px;
}

.emergency-tile.danger {
    background: #fdebea;
    color: #af3642;
}

.emergency-tile.success {
    background: #dcefe8;
    color: #2f7d66;
}

.emergency-tile.neutral {
    background: var(--paper);
    color: var(--ink);
}

@media (min-width: 1180px) {
    .directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

.topbar-title {
    display: block;
    font-size: 19px;
    line-height: 1.2;
}

.topbar-subtitle {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
}

.content-wrap.command-wrap { width: 100%; max-width: none; }

.command-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.command-hero h1 {
    margin: 6px 0 8px;
    font-family: var(--display-font);
    font-size: 38px;
    line-height: 1.05;
    letter-spacing: 0;
}

.command-actions,
.drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    padding: 12px 18px;
    color: #fff;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(200, 79, 24, .18);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.primary-button:hover,
.secondary-button:hover,
.edit-button:hover,
.site-button:hover,
.danger-button:hover {
    transform: translateY(-1px);
}

.primary-button.small {
    padding: 10px 14px;
}

.secondary-button {
    border: 1px solid var(--line);
    color: #4c4540;
    background: #fff;
    box-shadow: 0 8px 18px rgba(36, 21, 16, .06);
}

.secondary-button.danger {
    color: #b4232a;
    background: #fff5f5;
}

.secondary-button.small {
    padding: 10px 14px;
    white-space: nowrap;
}

.flash-message {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 13px;
    width: min(560px, calc(100vw - 42px));
    min-height: 58px;
    margin-bottom: 20px;
    border: 1px solid rgba(39, 133, 101, .22);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(39,133,101,.12), rgba(255,255,255,.82)),
        #f2fff9;
    color: #05603a;
    padding: 15px 54px 15px 18px;
    font-weight: 900;
    box-shadow: 0 22px 46px rgba(39, 133, 101, .16);
    overflow: hidden;
    animation: flashSlideIn .22s ease-out;
}

.flash-message::before {
    content: "✓";
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #dff8ec;
    color: #087052;
    font-size: 16px;
    font-weight: 900;
}

.flash-message::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #16a36d, rgba(22,163,109,.22));
    animation: flashTimer 6.5s linear forwards;
}

.flash-message.error {
    border-color: rgba(194, 49, 54, .22);
    background:
        linear-gradient(135deg, rgba(194,49,54,.1), rgba(255,255,255,.84)),
        #fff6f6;
    color: #b4232a;
    box-shadow: 0 16px 34px rgba(194, 49, 54, .1);
}

.flash-message.error::before {
    content: "!";
    background: #ffe4e6;
    color: #b4232a;
}

.flash-message.error::after {
    background: linear-gradient(90deg, #c23136, rgba(194,49,54,.22));
}

.flash-message.is-leaving {
    animation: flashSlideOut .18s ease-in forwards;
}

.flash-close {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(5, 96, 58, .12);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: currentColor;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

@keyframes flashSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes flashSlideOut {
    to { opacity: 0; transform: translateY(-8px); }
}

@keyframes flashTimer {
    from { transform: scaleX(1); transform-origin: left; }
    to { transform: scaleX(0); transform-origin: left; }
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    padding: 17px 18px;
    box-shadow: 0 10px 24px rgba(36, 21, 16, .06);
}

.metric-card.dark {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.metric-card span,
.resident-table-head span,
.drawer-form span {
    display: block;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.metric-card.dark span,
.metric-card.dark small {
    color: rgba(255,255,255,.68);
}

.metric-card strong {
    display: block;
    margin-top: 7px;
    font-size: 26px;
    line-height: 1;
}

.metric-card small {
    display: block;
    margin-top: 10px;
    color: #667085;
    font-weight: 700;
}

.directory-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 20px 44px rgba(36, 21, 16, .09);
}

.module-table-panel {
    overflow: hidden;
    margin-top: 18px;
    margin-bottom: 24px;
}

.module-table-panel .data-table-shell {
    overflow-x: auto;
}

.data-table-shell {
    width: 100%;
    overflow-x: auto;
}

.admin-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-data-table thead th {
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: #667085;
    padding: 13px 16px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .7px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-data-table tbody td {
    border-bottom: 1px solid #eef1f4;
    padding: 13px 16px;
    color: #3d3631;
    vertical-align: middle;
}

.admin-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-data-table thead th:first-child {
    border-top-left-radius: 18px;
}

.admin-data-table thead th:last-child {
    border-top-right-radius: 18px;
}

.admin-data-table tbody tr:hover td {
    background: #fff8f4;
}

.admin-data-table tbody tr.is-hidden {
    display: none;
}

.admin-data-table .dt-empty {
    padding: 34px 18px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.dt-container {
    color: var(--ink);
    font-family: inherit;
}

.dt-container .datatable-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: #fffdfb;
}

.dt-container .dt-length,
.dt-container .dt-info,
.dt-container .dt-paging {
    margin: 0;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.dt-container select.dt-input,
.dt-container .dt-input {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    padding: 8px 10px;
    font: inherit;
}

.dt-container .dt-paging .dt-paging-button {
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: var(--ink) !important;
    margin: 0 3px;
    padding: 8px 12px !important;
    font-weight: 800;
}

.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button:hover {
    border-color: var(--accent) !important;
    background: var(--accent) !important;
    color: #fff !important;
}

.dt-container .dt-paging .dt-paging-button.disabled {
    opacity: .45;
}

.directory-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fffdfb, #fbf7f2);
}

.table-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 0 14px;
    color: var(--muted);
    background: #fff;
}

.table-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
}

.chips.tight {
    margin: 0;
}

.resident-table-head,
.resident-table-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) 120px 150px minmax(150px, 1fr) 110px 96px;
    gap: 16px;
    align-items: center;
}

.resident-table-head {
    padding: 16px 22px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.resident-table-row {
    padding: 18px 22px;
    border-bottom: 1px solid #eef1f4;
}

.resident-table-row:last-child {
    border-bottom: 0;
}

.resident-table-row:hover {
    background: #fff8f4;
}

.resident-person {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.resident-person strong,
.resident-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resident-person small {
    margin-top: 3px;
    color: #667085;
    font-size: 13px;
}

.resident-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--soft);
    color: var(--accent-dark);
    font-weight: 900;
}

.resident-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.resident-avatar.large {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 24px;
}

.house-badge {
    display: inline-flex;
    width: fit-content;
    min-width: 70px;
    justify-content: center;
    border-radius: 999px;
    background: var(--soft);
    color: var(--accent-dark);
    padding: 8px 12px;
    font-weight: 900;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 7px 12px;
    background: #eef2f6;
    color: #4c5564;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .4px;
}

.status-pill.active {
    background: #e4f7ef;
    color: #087052;
}

.status-pill.inactive {
    background: #fde8e8;
    color: #b4232a;
}

.status-pill.pending {
    background: #fff4d6;
    color: #9a5b00;
}

.user-table-head,
.user-table-row {
    grid-template-columns: minmax(280px, 1.5fr) 130px 150px 120px minmax(190px, auto);
}

.row-actions {
    position: relative;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.table-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.row-actions form {
    margin: 0;
}

.notice-item:has(.row-actions) {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: start;
}

.contact-row:has(.row-actions),
.payment-row:has(.row-actions) {
    grid-template-columns: 72px minmax(0, 1fr) auto auto;
}

.payment-row.record-row:has(.row-actions) {
    grid-template-columns: 64px minmax(0, 1fr) minmax(110px, auto) minmax(150px, auto);
}

.inline-edit {
    position: relative;
}

.inline-edit summary,
.danger-button {
    border: 0;
    border-radius: 16px;
    padding: 10px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.inline-edit summary {
    list-style: none;
    background: #fff3ec;
    color: #9a3a05;
}

.inline-edit summary::-webkit-details-marker {
    display: none;
}

.danger-button {
    background: #fde8e8;
    color: #b4232a;
}

.inline-edit[open] {
    width: min(860px, calc(100vw - 56px));
}

.inline-edit[open] summary {
    display: inline-flex;
    margin-bottom: 12px;
}

.inline-edit .form-grid {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdfb;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(63, 51, 43, .08);
}

.row-actions .inline-edit[open] .form-grid {
    position: absolute;
    top: 46px;
    right: 0;
    z-index: 20;
    width: min(860px, calc(100vw - 96px));
}

.table-actions .inline-edit[open] .form-grid {
    top: 42px;
}

.path-text {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-gallery {
    margin-top: 0;
}

.compact-gallery img {
    width: 58px;
    height: 44px;
    border-radius: 10px;
}

.compact-form {
    gap: 14px;
}

.post-preview-image {
    display: block;
    width: min(260px, 100%);
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 12px 0 4px;
    background: #f5eee8;
}

.event-records .notice-item > div:nth-child(2),
.record-panel .notice-item > div:nth-child(2) {
    min-width: 0;
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(7, 10, 21, .62);
    backdrop-filter: blur(10px);
}

.confirm-backdrop[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(460px, 100%);
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,249,246,.96)),
        #fff;
    box-shadow: 0 34px 90px rgba(7, 10, 21, .32);
    padding: 26px;
    animation: confirmPop .18s ease-out;
}

.confirm-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #fff0f0;
    color: var(--danger);
    font-size: 26px;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.confirm-copy {
    margin-top: 18px;
}

.confirm-copy h2 {
    margin: 4px 0 8px;
    color: #101828;
    font-family: var(--display-font);
    font-size: 28px;
    line-height: 1.08;
}

.confirm-copy p:not(.eyebrow-line) {
    color: #667085;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.confirm-danger {
    min-height: 46px;
    padding: 12px 16px;
    box-shadow: 0 16px 28px rgba(194, 49, 54, .16);
}

body.modal-open {
    overflow: hidden;
}

@keyframes confirmPop {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    background: rgba(17, 24, 39, .52);
    backdrop-filter: blur(8px);
}

.drawer-overlay[hidden] {
    display: none;
}

.resident-drawer {
    width: min(680px, 100%);
    height: 100vh;
    overflow-y: auto;
    background: #fff;
    padding: 28px 30px;
    box-shadow: -20px 0 60px rgba(17, 24, 39, .22);
    animation: drawerIn .2s ease-out;
}

@keyframes drawerIn {
    from { transform: translateX(28px); opacity: .7; }
    to { transform: translateX(0); opacity: 1; }
}

.drawer-head,
.drawer-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.drawer-head {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
    margin: 4px 0;
    font-size: 30px;
}

.drawer-muted {
    color: #667085;
    font-weight: 700;
}

.drawer-summary {
    align-items: center;
    margin: 22px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff8f4;
}

.drawer-summary > div {
    flex: 1;
}

.drawer-summary strong,
.drawer-summary small {
    display: block;
}

.drawer-summary strong {
    font-size: 24px;
}

.drawer-summary small {
    color: #667085;
    font-weight: 700;
}

.drawer-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.drawer-form label.wide {
    grid-column: 1 / -1;
}

.drawer-form .wide {
    grid-column: 1 / -1;
}

.drawer-form input,
.drawer-form select,
.drawer-form textarea {
    width: 100%;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    padding: 13px 14px;
    color: var(--ink);
    font: inherit;
    outline: 0;
    resize: vertical;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.74);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.drawer-form input:focus,
.drawer-form select:focus,
.drawer-form textarea:focus {
    border-color: rgba(207,85,28,.72);
    background: #fffdfa;
    box-shadow: 0 0 0 4px rgba(207,85,28,.12);
}

.drawer-form select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #667085 50%), linear-gradient(135deg, #667085 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.drawer-form input[type="file"] {
    min-height: 48px;
    padding: 8px;
    background: #fff8f4;
    color: #667085;
}

.drawer-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 10px;
    background: #171412;
    color: #fff;
    padding: 10px 13px;
    font-weight: 900;
    cursor: pointer;
}

.modern-multiselect {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #fff8f4);
    padding: 12px;
}

.drawer-form .modern-multiselect .member-select-search {
    margin-top: 10px;
    background: #fff;
}

.multi-select-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.multi-select-tools button {
    border: 1px solid rgba(207,85,28,.22);
    border-radius: 999px;
    background: #fff4ed;
    color: var(--accent-dark);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.multi-select-tools button:hover {
    border-color: rgba(207,85,28,.45);
    background: #ffe8db;
}

.multi-select-summary {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 999px;
    background: #171412;
    color: #fff;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 900;
}

.multi-select-options {
    display: grid;
    gap: 8px;
    max-height: 240px;
    margin-top: 10px;
    overflow: auto;
    padding-right: 4px;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.82);
    padding: 10px 12px;
    color: #3f3934;
    cursor: pointer;
}

.multi-select-option:hover {
    border-color: rgba(207,85,28,.36);
    background: #fffaf6;
}

.multi-select-option.selected {
    border-color: rgba(207,85,28,.62);
    background: #fff2ea;
    box-shadow: 0 8px 18px rgba(207,85,28,.08);
}

.multi-select-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.multi-select-option span {
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 800;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    padding: 12px 14px;
}

.toggle-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.toggle-line span {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
}

.settings-card {
    max-width: 720px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 14px 32px rgba(36, 21, 16, .08);
}

.password-form {
    display: grid;
    gap: 18px;
}

.password-form label span {
    display: block;
    margin-bottom: 8px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.password-form input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
    padding: 14px 16px;
    font: inherit;
    outline: 0;
}

.field-error {
    display: block;
    margin-top: 7px;
    color: #b4232a;
    font-weight: 700;
}

.pagination-strip {
    padding: 16px;
    border-top: 1px solid var(--line);
    background: #fffdfb;
}

.pagination-strip nav > div:first-child {
    display: none;
}

.pagination-strip nav > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #667085;
    font-size: 13px;
    font-weight: 700;
}

.pagination-strip a,
.pagination-strip span {
    border-radius: 10px !important;
}

.public-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 88% 9%, rgba(200, 79, 24, .09) 0 150px, transparent 152px),
        linear-gradient(110deg, #fffdfb, #f7f0eb);
}

.public-shell {
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, .7fr);
    gap: 42px;
    align-items: center;
    padding: 54px 0;
}

.public-shell.narrow {
    grid-template-columns: minmax(0, 820px);
    justify-content: center;
}

.public-panel {
    width: 100%;
}

.public-panel h1 {
    margin: 8px 0 14px;
    font-size: 58px;
    line-height: 1.02;
}

.public-panel h2,
.public-info h2 {
    margin: 30px 0 10px;
    font-size: 24px;
}

.public-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.public-form label span {
    display: block;
    margin-bottom: 8px;
    color: #4c4540;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.public-form input,
.public-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255,255,255,.82);
    padding: 15px 16px;
    color: var(--ink);
    font: inherit;
    outline: 0;
}

.public-form input:focus,
.public-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(200, 79, 24, .12);
}

.public-info {
    border-left: 1px solid var(--line);
    padding-left: 34px;
}

.public-info a,
.public-panel a {
    display: inline-flex;
    margin-top: 18px;
    color: var(--accent-dark);
    font-weight: 900;
}

.about-shell {
    grid-template-columns: minmax(0, .9fr) minmax(420px, .8fr);
}

.about-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.about-actions a {
    margin-top: 0;
    text-decoration: none;
}

.about-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.about-list article {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.7);
    padding: 18px;
}

.about-list strong,
.about-list span {
    display: block;
}

.about-list span {
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.55;
}

.drawer-actions {
    margin-top: 24px;
}

.resident-table-row.is-hidden {
    display: none;
}

@media (max-width: 1320px) {
    :root {
        --sidebar-width: 260px;
        --page-x: 28px;
    }

    .brand-mark {
        width: 50px;
        height: 50px;
        border-radius: 16px;
        font-size: 15px;
    }

    .brand strong {
        font-size: 19px;
    }

    .nav-link {
        min-height: 52px;
        padding: 0 14px;
        font-size: 14px;
    }

    .app-title {
        font-size: 56px;
    }

    .hero-brand-card {
        width: 170px;
        min-height: 190px;
    }

    .module-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

@media (max-width: 1180px) {
    :root {
        --sidebar-width: 236px;
        --page-x: 24px;
    }

    .topbar {
        padding: 16px 20px;
    }

    .search-mini {
        max-width: 420px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-brand-card {
        width: 100%;
        min-height: auto;
        grid-template-columns: auto auto auto;
        align-items: center;
        justify-content: start;
        text-align: left;
    }

    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-analytics {
        grid-template-columns: 1fr;
    }

    .directory-toolbar {
        grid-template-columns: 1fr;
    }

    .resident-table {
        overflow-x: auto;
    }

    .resident-table-head,
    .resident-table-row {
        min-width: 980px;
    }

    .admin-data-table {
        min-width: 860px;
    }
}

@media (max-width: 980px) {
    :root {
        --page-x: 22px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        padding: 18px 18px 16px;
        border-radius: 0 0 24px 24px;
    }

    .brand {
        margin-bottom: 16px;
    }

    .nav-section-label {
        display: none;
    }

    .side-nav {
        display: flex;
        gap: 10px;
        margin: 0 -4px;
        padding: 2px 4px 12px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
    }

    .nav-link {
        min-width: max-content;
        min-height: 46px;
        border-radius: 999px;
        padding: 0 16px;
        scroll-snap-align: start;
    }

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

    .sidebar-footer {
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        padding-top: 10px;
    }

    .logout-button {
        min-height: 46px;
    }

    .topbar {
        margin: 18px var(--page-x) 0;
        min-height: auto;
        align-items: stretch;
        flex-direction: column;
        border-radius: 20px;
        padding: 16px;
    }

    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .search-mini {
        max-width: none;
        width: 100%;
    }

    .user-chip {
        justify-content: space-between;
    }

    .topbar-logout-form,
    .topbar-logout {
        width: 100%;
    }

    .command-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-section-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    :root {
        --page-x: 16px;
        --hero-radius: 18px;
        --card-radius: 14px;
    }

    .sidebar {
        padding: 14px 14px 12px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 13px;
    }

    .brand strong {
        font-size: 17px;
    }

    .brand span,
    .sidebar-user-card small {
        font-size: 11px;
    }

    .nav-link {
        min-height: 42px;
        padding: 0 13px;
        font-size: 13px;
    }

    .nav-icon {
        width: auto;
        font-size: 16px;
    }

    .sidebar-footer {
        grid-template-columns: 1fr;
    }

    .topbar {
        margin: 12px var(--page-x) 0;
        padding: 14px;
    }

    .topbar-title {
        font-size: 17px;
    }

    .topbar-subtitle,
    .search-mini input {
        font-size: 13px;
    }

    .content-wrap {
        padding: 18px var(--page-x) 34px;
    }

    .hero-panel {
        padding: 24px 20px;
    }

    .dashboard-hero {
        min-height: auto;
    }

    .app-title {
        font-size: 40px;
        line-height: 1.02;
    }

    .hero-panel .muted {
        font-size: 14px;
    }

    .stat-strip {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat-pill {
        min-width: 0;
    }

    .hero-brand-card {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 18px;
    }

    .dashboard-section-head h2 {
        font-size: 24px;
    }

    .dashboard-section-head > span {
        width: 100%;
        text-align: center;
    }

    .public-shell {
        width: min(100% - 32px, 720px);
        grid-template-columns: 1fr;
        gap: 26px;
        align-items: start;
        padding: 32px 0;
    }

    .public-info {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 24px 0 0;
    }

    .about-shell {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .module-grid,
    .drawer-form {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 126px;
    }

    .analytics-card {
        padding: 18px;
        border-radius: 18px;
    }

    .analytics-head {
        flex-direction: column;
    }

    .donut-wrap {
        grid-template-columns: 1fr;
    }

    .payment-chart-layout {
        grid-template-columns: 1fr;
    }

    .animated-pie,
    .animated-pie.compact {
        margin: 0 auto;
    }

    .line-chart {
        min-height: 220px;
        overflow-x: auto;
    }

    .line-chart svg {
        min-width: 560px;
    }

    .chart-labels {
        min-width: 560px;
        font-size: 10px;
    }

    .notice-list {
        padding: 4px 16px;
    }

    .notice-item {
        grid-template-columns: 50px minmax(0, 1fr);
        gap: 13px;
        padding: 16px 0;
    }

    .soft-icon {
        width: 50px;
        height: 50px;
        border-radius: 15px;
        font-size: 23px;
    }

    .notice-item h3 {
        font-size: 17px;
    }

    .directory-panel {
        border-radius: 16px;
    }

    .directory-toolbar {
        padding: 12px;
    }

    .event-grid-panel {
        padding: 14px;
    }

    .event-grid-toolbar {
        align-items: stretch;
        padding: 0 0 14px;
    }

    .event-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 14px;
    }

    .event-card {
        min-height: 0;
        border-radius: 18px;
        padding: 16px;
    }

    .event-card-top,
    .event-detail-list div {
        align-items: flex-start;
        flex-direction: column;
    }

    .event-date-pill,
    .event-detail-list strong {
        align-items: flex-start;
        text-align: left;
    }

    .event-card-body h2 {
        font-size: 22px;
    }

    .event-card-actions .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .event-card-actions .edit-button,
    .event-card-actions .danger-button,
    .event-card-actions form {
        width: 100%;
    }

    .data-table-shell {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-data-table {
        min-width: 760px;
    }

    .flash-message {
        width: 100%;
        border-radius: 18px;
        padding-right: 48px;
    }

    .confirm-backdrop {
        align-items: end;
        padding: 14px;
    }

    .confirm-dialog {
        border-radius: 24px;
        padding: 22px;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-actions .secondary-button,
    .confirm-actions .danger-button {
        width: 100%;
    }

    .dt-container .datatable-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .dt-container .dt-paging {
        overflow-x: auto;
        white-space: nowrap;
    }

    .resident-drawer {
        width: 100%;
        padding: 22px 18px;
    }

    .drawer-head {
        gap: 12px;
    }

    .drawer-head h2 {
        font-size: 24px;
    }

    .drawer-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .drawer-actions .primary-button,
    .drawer-actions .secondary-button {
        width: 100%;
    }

    .record-panel {
        padding: 6px 16px;
    }

    .record-panel .notice-item:has(.row-actions),
    .record-panel .contact-row:has(.row-actions),
    .payment-row.record-row:has(.row-actions) {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .record-actions,
    .record-panel .notice-item .row-actions,
    .record-panel .contact-row .row-actions,
    .payment-row.record-row .row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        min-width: 0;
    }

    .row-actions .inline-edit[open] .form-grid {
        position: static;
        width: 100%;
    }
}

@media (max-width: 420px) {
    .app-title {
        font-size: 34px;
    }

    .kicker {
        max-width: 100%;
        letter-spacing: 2px;
        font-size: 10px;
    }

    .module-card-top {
        align-items: flex-start;
    }

    .module-label {
        font-size: 16px;
    }

    .analytics-head h2,
    .section-title {
        font-size: 20px;
    }

    .resident-person {
        gap: 10px;
    }

    .row-actions,
    .table-actions {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
