:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;

    --border: #e5eaf0;

    --text: #172033;
    --text-soft: #647084;
    --text-muted: #8b95a7;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;

    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --sidebar-text: #d1d5db;

    --success: #16a34a;

    --shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --shadow-md:
        0 10px 30px rgba(15, 23, 42, 0.06);

    --radius: 14px;
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;

    min-height: 100%;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text);
    background: var(--bg);
}


body {
    overflow-x: hidden;
}


a {
    color: inherit;
    text-decoration: none;
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


.app-shell {
    min-height: 100vh;

    display: flex;
}


.sidebar {
    width: 260px;

    flex: 0 0 260px;

    display: flex;
    flex-direction: column;

    background: var(--sidebar);
    color: var(--sidebar-text);
}


.brand {
    min-height: 82px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 20px 22px;

    border-bottom: 1px solid
        rgba(255, 255, 255, 0.08);
}


.brand-logo {
    width: 128px;
    height: 92px;

    object-fit: cover;

    border-radius: 0;
}


.brand-mark {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    color: white;
    background: var(--primary);

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}


.brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.brand-text strong {
    color: white;

    font-size: 15px;
}


.brand-text span {
    color: #9ca3af;

    font-size: 11px;
}


.sidebar-nav {
    flex: 1;

    padding: 24px 14px;
}


.nav-section-title {
    padding: 18px 12px 8px;

    color: #6b7280;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 12px;
    margin: 3px 0;

    border-radius: 9px;

    color: #9ca3af;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease;
}


.nav-item:hover {
    color: white;
    background: var(--sidebar-soft);
}


.nav-item.active {
    color: white;
    background: var(--primary);
}


.nav-item.active:hover {
    background: var(--primary-dark);
}


.nav-item.disabled {
    opacity: 0.65;

    cursor: default;
}


.nav-item.disabled:hover {
    color: #9ca3af;
    background: transparent;
}


.nav-icon {
    width: 20px;

    flex: 0 0 20px;

    text-align: center;

    font-size: 16px;
}


.sidebar-footer {
    padding: 18px;

    border-top: 1px solid
        rgba(255, 255, 255, 0.08);
}


.system-status {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px;

    border-radius: 10px;

    background: rgba(255, 255, 255, 0.04);
}


.status-dot {
    width: 8px;
    height: 8px;

    flex: 0 0 auto;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 0 4px
        rgba(22, 163, 74, 0.12);
}


.system-status div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.system-status strong {
    color: #d1d5db;

    font-size: 11px;
}


.system-status small {
    color: #6b7280;

    font-size: 10px;
}


.sidebar-backdrop {
    display: none;
}


.app-main {
    min-width: 0;

    flex: 1;
}


.topbar {
    height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 34px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);
}


.topbar-left,
.topbar-right,
.user-menu {
    display: flex;
    align-items: center;
}


.topbar-left {
    gap: 14px;

    min-width: 0;
}


.topbar-label {
    display: block;

    margin-bottom: 3px;

    color: var(--text-muted);

    font-size: 11px;
}


.topbar-left strong {
    font-size: 14px;
}


.topbar-right {
    gap: 20px;
}


.notification-button,
.mobile-menu-button {
    border: 0;

    color: var(--text-soft);
    background: transparent;

    cursor: pointer;
}


.notification-button {
    font-size: 24px;
}


.notification-button:hover,
.mobile-menu-button:hover {
    color: var(--text);
}


.mobile-menu-button {
    display: none;

    width: 40px;
    height: 40px;

    place-items: center;

    padding: 0;

    border-radius: 10px;

    font-size: 20px;
}


.mobile-menu-button:hover {
    background: var(--surface-soft);
}


.user-menu {
    position: relative;

    gap: 10px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    padding: 0;

    border: none;
    border-radius: 50%;

    color: white;
    background: var(--primary);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}


.user-avatar:hover {
    background: var(--primary-dark);
}


.user-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.user-details strong {
    font-size: 13px;
}


.user-details span {
    color: var(--text-muted);

    font-size: 11px;
}


.logout-link {
    margin-left: 10px;

    color: var(--text-soft);

    font-size: 12px;
}


.logout-link:hover {
    color: var(--primary);
}


.content {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;

    padding: 38px 42px;
}


.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 32px;
}


.eyebrow {
    display: block;

    margin-bottom: 7px;

    color: var(--primary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


h1,
h2,
h3,
p {
    margin-top: 0;
}


h1 {
    margin-bottom: 8px;

    font-size: 30px;
    line-height: 1.2;
}


.page-header p {
    margin-bottom: 0;

    color: var(--text-soft);

    font-size: 14px;
}


.page-header-actions {
    display: flex;

    gap: 10px;
}


.button {
    padding: 10px 16px;

    border: 1px solid transparent;
    border-radius: 8px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;
}


.button-primary {
    color: white;
    background: var(--primary);
}


.button-primary:hover {
    background: var(--primary-dark);
}


.button-secondary {
    color: var(--text);
    background: var(--surface);

    border-color: var(--border);
}


.button-secondary:hover {
    background: var(--surface-soft);
}


.stat-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 24px;
}


.stat-card {
    padding: 22px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}


.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}


.stat-label {
    color: var(--text-soft);

    font-size: 13px;
    font-weight: 600;
}


.stat-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    color: var(--primary);
    background: #eff6ff;

    font-size: 17px;
}


.stat-value {
    display: block;

    margin-bottom: 5px;

    font-size: 30px;
    line-height: 1;
}


.stat-description {
    color: var(--text-muted);

    font-size: 12px;
}


.dashboard-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.6fr)
        minmax(320px, 1fr);

    gap: 24px;
}


.panel {
    min-height: 320px;

    padding: 24px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}


.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 24px;
}


.panel-header h2 {
    margin-bottom: 5px;

    font-size: 16px;
}


.panel-header p {
    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 12px;
}


.panel-link {
    color: var(--primary);

    font-size: 12px;
    font-weight: 600;
}


.empty-state {
    min-height: 200px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
}


.empty-state-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-bottom: 14px;

    border-radius: 50%;

    color: var(--text-muted);
    background: var(--surface-soft);

    font-size: 24px;
}


.empty-state h3 {
    margin-bottom: 7px;

    font-size: 14px;
}


.empty-state p {
    max-width: 300px;

    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 12px;
    line-height: 1.6;
}


.quick-actions {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px;

    border-radius: 10px;

    transition:
        background 0.15s ease;
}


.quick-action:hover {
    background: var(--surface-soft);
}


.quick-action.disabled {
    opacity: 0.65;
}


.quick-action-icon {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    color: var(--primary);
    background: #eff6ff;

    font-size: 16px;
}


.quick-action span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.quick-action strong {
    font-size: 13px;
}


.quick-action small {
    color: var(--text-muted);

    font-size: 11px;
}


/* =========================
   User dropdown
========================= */


.user-dropdown {
    position: absolute;

    top: 48px;
    right: 0;

    width: 160px;

    display: none;
    flex-direction: column;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-md);

    overflow: hidden;

    z-index: 200;
}


.user-dropdown.open {
    display: flex;
}


.user-dropdown a {
    padding: 12px 16px;

    font-size: 13px;

    color: var(--text);
}


.user-dropdown a:hover {
    background: var(--surface-soft);
}


/* =========================
   Public pages
========================= */


.landing-page {
    background:
        linear-gradient(
            135deg,
            #f8fafc,
            #eef4ff
        );
}


.landing-header {
    max-width: 1200px;

    margin: auto;

    height: 84px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 24px;
}


.landing-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 18px;
}


.landing-brand img {
    width: 42px;
    height: 42px;

    object-fit: cover;

    border-radius: 10px;
}


.landing-header nav {
    display: flex;

    gap: 24px;

    color: var(--text-soft);
}


.landing-hero {
    max-width: 1200px;

    margin: 80px auto;

    padding: 0 24px;

    display: grid;

    grid-template-columns:
        1fr 380px;

    gap: 80px;

    align-items: center;
}


.hero-content h1 {
    font-size: 52px;

    line-height: 1.1;
}


.hero-content p {
    max-width: 520px;

    color: var(--text-soft);

    font-size: 18px;

    line-height: 1.7;
}


.hero-actions {
    display: flex;

    gap: 12px;

    margin-top: 30px;
}


.hero-card {
    background: white;

    padding: 28px;

    border-radius: 24px;

    box-shadow: var(--shadow-md);
}


.hero-card-header {
    display: flex;
    justify-content: space-between;

    margin-bottom: 30px;
}


.hero-stat {
    padding: 18px 0;

    border-bottom: 1px solid var(--border);
}


.hero-stat strong {
    display: block;

    font-size: 32px;
}


.hero-stat span {
    color: var(--text-muted);
}


.feature-section {
    max-width: 1200px;

    margin: 80px auto;

    padding: 0 24px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;
}


.feature-card {
    background: white;

    padding: 28px;

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}


/* =========================
   Login
========================= */


.auth-page {
    min-height: 100vh;

    display: grid;

    place-items: center;
}


.auth-container {
    width: 100%;

    max-width: 420px;

    padding: 24px;
}


.auth-card {
    background: white;

    padding: 40px;

    border-radius: 24px;

    box-shadow: var(--shadow-md);
}


.auth-logo {
    width: 70px;
    height: 70px;

    object-fit: cover;

    border-radius: 16px;

    margin-bottom: 20px;
}


.auth-card form {
    display: flex;
    flex-direction: column;

    gap: 18px;

    margin-top: 30px;
}


.auth-card label {
    display: flex;
    flex-direction: column;

    gap: 8px;

    font-size: 13px;
    font-weight: 600;
}


.auth-card input {
    width: 100%;

    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 14px;
}


/* =========================
   Tablet
========================= */


@media (max-width: 1100px) {

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


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


    .content {
        padding-left: 30px;
        padding-right: 30px;
    }

}


/* =========================
   Mobile navigation
========================= */


@media (max-width: 760px) {

    .sidebar {
        position: fixed;

        top: 0;
        bottom: 0;
        left: 0;

        z-index: 1000;

        width: min(280px, 86vw);

        flex: none;

        transform: translateX(-100%);

        transition:
            transform 0.22s ease;

        box-shadow:
            10px 0 30px
            rgba(15, 23, 42, 0.16);
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .sidebar-backdrop {
        position: fixed;

        inset: 0;

        z-index: 999;

        display: block;

        background:
            rgba(15, 23, 42, 0.42);

        opacity: 0;

        pointer-events: none;

        transition:
            opacity 0.22s ease;
    }


    .sidebar-backdrop.open {
        opacity: 1;

        pointer-events: auto;
    }


    body.mobile-menu-open {
        overflow: hidden;
    }


    .mobile-menu-button {
        display: grid;
    }


    .topbar {
        height: 70px;

        padding: 0 18px;
    }


    .topbar-right {
        gap: 10px;
    }


    .notification-button {
        font-size: 22px;
    }


    .user-details {
        display: none;
    }


    .logout-link {
        margin-left: 0;
    }


    .content {
        padding: 28px 18px;
    }


    .page-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 18px;

        margin-bottom: 24px;
    }


    .page-header-actions {
        width: 100%;
    }


    .page-header-actions .button {
        flex: 1;
    }


    h1 {
        font-size: 26px;
    }


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

        gap: 40px;

        margin: 50px auto;
    }


    .hero-content h1 {
        font-size: 40px;
    }


    .feature-section {
        grid-template-columns: 1fr;

        margin: 50px auto;
    }

}


/* =========================
   Small mobile
========================= */


@media (max-width: 500px) {

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


    .topbar-label {
        display: none;
    }


    .topbar-left strong {
        font-size: 13px;
    }


    .topbar {
        padding: 0 14px;
    }


    .content {
        padding:
            22px 14px
            32px;
    }


    .panel {
        padding: 18px;
    }


    .stat-card {
        padding: 18px;
    }


    .page-header-actions {
        flex-direction: column;
    }


    .page-header-actions .button {
        width: 100%;
    }


    .auth-card {
        padding: 28px 22px;
    }


    .hero-content h1 {
        font-size: 34px;
    }

}

/* =========================
   Residents
========================= */

.residents-panel {
    min-height: 0;
}


.resident-search {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 24px;
}


.resident-search input {
    min-width: 0;
    flex: 1;

    height: 42px;

    padding: 0 14px;

    color: var(--text);
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 9px;

    font: inherit;
    font-size: 13px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.resident-search input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.10);
}


.resident-table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: 10px;
}


.resident-table {
    width: 100%;

    border-collapse: collapse;

    font-size: 13px;
}


.resident-table th {
    padding: 12px 16px;

    color: var(--text-muted);
    background: var(--surface-soft);

    border-bottom: 1px solid var(--border);

    font-size: 11px;
    font-weight: 700;

    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    white-space: nowrap;
}


.resident-table td {
    padding: 15px 16px;

    border-bottom: 1px solid var(--border);

    vertical-align: middle;
}


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


.resident-table tbody tr:hover {
    background: var(--surface-soft);
}


.resident-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.resident-name strong {
    color: var(--text);

    font-size: 13px;
    font-weight: 650;
}


.resident-name small {
    color: var(--text-muted);

    font-size: 11px;
}


.resident-actions {
    width: 1%;

    text-align: right;

    white-space: nowrap;
}


.resident-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;

    padding: 7px 12px;

    font-size: 12px;
}


.status-badge {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 4px 9px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;

    text-transform: capitalize;
}


.status-active {
    color: var(--success);

    background: rgba(22, 163, 74, 0.10);
}


.residents-empty {
    min-height: 260px;

    border: 1px dashed var(--border);
    border-radius: 10px;
}


.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


@media (max-width: 600px) {

    .resident-search {
        align-items: stretch;
        flex-direction: column;
    }


    .resident-search input {
        width: 100%;
    }


    .resident-search .button {
        width: 100%;

        text-align: center;
    }


    .residents-panel {
        padding: 18px;
    }


    .resident-table-wrapper {
        border: 0;
        overflow: visible;
    }


    .resident-table,
    .resident-table tbody {
        display: block;
    }


    .resident-table thead {
        display: none;
    }


    .resident-table tr {
        display: grid;

        grid-template-columns: 1fr auto;

        gap: 12px;

        padding: 16px 0;

        border-bottom: 1px solid var(--border);
    }


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


    .resident-table td {
        display: block;

        padding: 0;

        border: 0;
    }


    .resident-table td:nth-child(2) {
        grid-column: 1;

        color: var(--text-muted);

        font-size: 11px;
    }


    .resident-table td:nth-child(3) {
        grid-column: 1;
    }


    .resident-table td:nth-child(4) {
        grid-column: 2;
        grid-row: 1 / span 3;

        align-self: center;
    }


    .resident-actions {
        width: auto;
    }


    .resident-actions .button {
        min-height: 38px;

        padding: 8px 14px;
    }

}

/* =========================
   Resident profile
========================= */


.resident-profile-header {
    margin-bottom: 28px;
}


.resident-profile-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}


.resident-profile-card {
    min-height: 0;
}


.resident-profile-card-wide {
    grid-column: 1 / -1;
}


.resident-profile-card .panel-header {
    align-items: center;

    margin-bottom: 20px;
}


.resident-status {
    display: inline-flex;

    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}


.resident-status-active {
    color: #166534;

    background: #dcfce7;
}


.resident-status-inactive {
    color: #64748b;

    background: #f1f5f9;
}


.resident-status-discharged {
    color: #92400e;

    background: #fef3c7;
}


.resident-details {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    border-top: 1px solid var(--border);
}


.resident-detail {
    display: flex;

    flex-direction: column;

    gap: 7px;

    min-width: 0;

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}


.resident-detail:nth-child(odd) {
    border-right: 1px solid var(--border);
}


.resident-detail-label {
    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.04em;
    text-transform: uppercase;
}


.resident-detail-value {
    min-width: 0;

    color: var(--text);

    font-size: 14px;

    overflow-wrap: anywhere;
}


.resident-detail-value strong {
    font-weight: 600;
}


.resident-detail-break {
    overflow-wrap: anywhere;
}


.resident-address {
    display: flex;

    flex-direction: column;

    gap: 5px;

    padding: 4px 0;

    color: var(--text);

    font-size: 14px;
    line-height: 1.6;
}


.resident-detail-empty {
    color: var(--text-muted);
}


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


@media (max-width: 760px) {

    .resident-profile-grid {
        grid-template-columns: 1fr;

        gap: 16px;
    }


    .resident-profile-card-wide {
        grid-column: auto;
    }


    .resident-details {
        grid-template-columns: 1fr;
    }


    .resident-detail:nth-child(odd) {
        border-right: 0;
    }


    .resident-details-record {
        grid-template-columns: 1fr;
    }


    .resident-profile-header .page-header-actions {
        width: auto;
    }


    .resident-profile-header .button {
        flex: 0 0 auto;
    }

}


@media (max-width: 500px) {

    .resident-profile-header .page-header-actions {
        width: 100%;
    }


    .resident-profile-header .button {
        width: 100%;

        text-align: center;
    }


    .resident-profile-card {
        padding: 18px;
    }


    .resident-profile-card .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }


    .resident-detail {
        padding: 16px 0;
    }

}

/* ==========================================================================
   Flash messages
   ========================================================================== */

.flash-message {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 24px;
    padding: 14px 16px;

    border: 1px solid;
    border-radius: 10px;

    font-size: 14px;
    line-height: 1.5;
}

.flash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    flex: 0 0 24px;

    border-radius: 50%;

    font-size: 13px;
    font-weight: 700;
}

.flash-success {
    border-color: #b7dfc5;
    background: #f0faf3;
    color: #1d6b3a;
}

.flash-success .flash-icon {
    background: #d8f1df;
    color: #1d6b3a;
}

.flash-error {
    border-color: #edb8b8;
    background: #fff3f3;
    color: #9b2c2c;
}

.flash-error .flash-icon {
    background: #f9dddd;
    color: #9b2c2c;
}

.flash-warning {
    border-color: #ead39b;
    background: #fff9e8;
    color: #765b00;
}

.flash-warning .flash-icon {
    background: #f8eab9;
    color: #765b00;
}

.flash-info {
    border-color: #b8d5ed;
    background: #f1f8fd;
    color: #245b82;
}

.flash-info .flash-icon {
    background: #dcecf8;
    color: #245b82;
}

/* ==========================================================================
   Resident contacts
   ========================================================================== */

.resident-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resident-contact-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    background: var(--surface-color, #ffffff);
}

.resident-contact-main {
    min-width: 0;
    flex: 1;
}

.resident-contact-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.resident-contact-heading h3 {
    margin: 0;
}

.resident-contact-relationship {
    color: var(--muted-text, #6b7280);
    font-size: 0.9rem;
}

.resident-contact-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-muted, #f3f4f6);
    color: var(--text-color, #374151);
    font-size: 0.75rem;
    font-weight: 600;
}

.resident-contact-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 0.85rem;
    color: var(--muted-text, #6b7280);
    font-size: 0.9rem;
}

.resident-contact-actions {
    flex-shrink: 0;
}

.resident-contacts-more {
    margin-top: 1rem;
    text-align: center;
}

.resident-contacts-more a {
    font-weight: 600;
}

.resident-contact-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.resident-contact-role {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.75rem;
    cursor: pointer;
}

.resident-contact-role input {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.resident-contact-role span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resident-contact-role small {
    color: var(--muted-text, #6b7280);
    line-height: 1.4;
}

@media (max-width: 700px) {

    .resident-contact-card {
        flex-direction: column;
    }

    .resident-contact-actions {
        width: 100%;
    }

    .resident-contact-actions .button {
        width: 100%;
    }

    .resident-contact-role-grid {
        grid-template-columns: 1fr;
    }

}

/* ==========================================================================
   Forms
========================================================================== */


.form-field {
    display: flex;

    flex-direction: column;

    gap: 8px;

}


.form-field label {

    color: var(--text-soft);

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 0.02em;

}


.form-field input,
.form-field select,
.form-field textarea {

    width: 100%;

    min-height: 44px;

    padding: 10px 14px;

    color: var(--text);

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 10px;

    outline: none;

    font-size: 14px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;

}


.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {

    border-color: #cbd5e1;

}


.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {

    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(37, 99, 235, 0.12);

}


.form-field textarea {

    min-height: 120px;

    resize: vertical;

}


.form-field input::placeholder,
.form-field textarea::placeholder {

    color: var(--text-muted);

}


.resident-edit-form {

    display: flex;

    flex-direction: column;

    gap: 24px;

}


.resident-edit-card {

    min-height: 0;

}


.resident-form-grid {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;

}


.form-field-wide {

    grid-column: 1 / -1;

}


.resident-edit-actions {

    display: flex;

    justify-content: flex-end;

    gap: 12px;

    padding-bottom: 20px;

}



@media (max-width: 760px) {

    .resident-form-grid {

        grid-template-columns: 1fr;

    }


    .form-field-wide {

        grid-column: auto;

    }


    .resident-edit-actions {

        flex-direction: column-reverse;

    }


    .resident-edit-actions .button {

        width: 100%;

    }

}
