:root {
    color-scheme: light;
    --bg: #eef6fb;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-soft: #f6fbff;
    --border: rgba(17, 87, 108, 0.13);
    --shadow: 0 24px 64px rgba(12, 48, 70, 0.12);
    --text: #12384a;
    --muted: #587385;
    --accent: #0f6b73;
    --accent-strong: #114f64;
    --info: #2558c8;
    --warning: #d67a10;
    --danger: #cd4b5c;
    --success: #1a8e62;
    --navy: #10253b;
    --card-teal: #eaf8f8;
    --card-blue: #edf4ff;
    --card-orange: #fff6ea;
    --card-red: #fff2f2;
    --card-green: #eefbf3;
    --radius-xl: 2rem;
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --radius-sm: 0.75rem;
    --font: "Trebuchet MS", "Aptos", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
    background:
        radial-gradient(circle at top left, rgba(49, 119, 203, 0.12), transparent 30rem),
        radial-gradient(circle at bottom right, rgba(15, 107, 115, 0.12), transparent 24rem),
        linear-gradient(180deg, #f8fcff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: var(--font);
}

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

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

.is-hidden {
    display: none !important;
}

.eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.app-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

.auth-screen {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 16%, rgba(56, 133, 224, 0.18), transparent 18rem),
        radial-gradient(circle at 85% 8%, rgba(20, 98, 115, 0.16), transparent 20rem),
        linear-gradient(145deg, #fdfefe 0%, #e4f0fb 55%, #d7e9fa 100%);
}

.auth-panel {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 30rem);
    gap: 2rem;
    padding: 2.25rem;
    align-items: center;
}

.auth-hero {
    display: grid;
    gap: 1.5rem;
}

.auth-mark {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(14, 72, 106, 0.12);
    font-weight: 800;
    color: #103a74;
    box-shadow: 0 14px 28px rgba(16, 58, 116, 0.08);
}

.auth-hero-card,
.auth-card,
.sidebar,
.card,
.list-card,
.panel-card,
.modal-panel {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-hero-card {
    border-radius: 2rem;
    padding: 2rem;
}

.auth-logo {
    width: min(100%, 32rem);
    margin-inline: auto;
}

.auth-subtitle {
    margin: 0;
    text-align: center;
    color: #446b87;
    font-size: 1.05rem;
}

.auth-card {
    border-radius: 2rem;
    padding: 2rem;
    display: grid;
    gap: 1rem;
}

.section-heading h1,
.section-heading h2,
.section-heading h3,
.view-title {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    line-height: 1.1;
}

.section-heading p,
.header-subtitle,
.helper-text,
.field > span,
.field small {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 700;
    background: #dff9f2;
    color: var(--accent);
}

.auth-tabs,
.segmented,
.toolbar-row,
.action-row,
.stat-grid,
.summary-grid,
.field-grid,
.inline-fields,
.split-card {
    display: grid;
    gap: 0.85rem;
}

.auth-tabs {
    grid-template-columns: repeat(3, 1fr);
}

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

.tab-button,
.segmented-button,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.sidebar-footer-button,
.nav-button,
.icon-button {
    appearance: none;
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.tab-button,
.segmented-button,
.ghost-button,
.secondary-button,
.sidebar-footer-button,
.nav-button {
    min-height: 3rem;
    border-radius: 1rem;
    background: rgba(17, 87, 108, 0.06);
    color: var(--text);
    padding: 0.85rem 1rem;
    font-weight: 700;
}

.tab-button.is-active,
.segmented-button.is-active,
.nav-button.is-active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 14px 26px rgba(15, 95, 112, 0.24);
}

.nav-button.is-danger {
    background: linear-gradient(135deg, #fff0f3 0%, #ffe2e7 100%);
    color: var(--danger);
}

.nav-button.is-pro-feature {
    position: relative;
}

.nav-button.is-pro-feature:not(.is-locked) {
    border: 1px solid rgba(214, 122, 16, 0.18);
    background: linear-gradient(135deg, #fff9ec 0%, #eef8ff 100%);
}

.nav-button.is-pro-feature:not(.is-locked) .nav-status {
    color: #d67a10;
}

.nav-button.is-pro-feature.is-active:not(.is-locked) {
    border-color: rgba(255, 177, 76, 0.45);
    background: linear-gradient(135deg, #0f6b73 0%, #10253b 100%);
    color: #fff;
}

.nav-button.is-pro-feature.is-active:not(.is-locked) .nav-status {
    color: #ffd27a;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.35);
}

.nav-button.is-locked,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.nav-button.is-locked {
    background: linear-gradient(135deg, #f3f6f8 0%, #e8eef2 100%);
    color: #6d7c86;
}

.nav-status {
    display: inline-grid;
    place-items: center;
    min-width: 1.65rem;
    min-height: 1.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    font-weight: 900;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 3.2rem;
    border-radius: 1.1rem;
    padding: 0.95rem 1.2rem;
    font-weight: 800;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    box-shadow: 0 16px 28px rgba(17, 79, 100, 0.24);
}

.secondary-button {
    background: linear-gradient(135deg, #eef5ff 0%, #dbe9ff 100%);
    color: var(--info);
}

.danger-button {
    background: linear-gradient(135deg, #fff0f3 0%, #ffe2e7 100%);
    color: var(--danger);
}

.pro-feature-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.pro-feature-button span {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    min-height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    font-weight: 900;
}

.pro-feature-button.is-pro {
    border: 1px solid rgba(214, 122, 16, 0.24);
}

.pro-feature-button.is-locked {
    filter: grayscale(0.18);
}

.ghost-button {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border);
}

.sidebar-footer-button.is-danger {
    color: var(--danger);
    background: #fff1f4;
}

.tab-button:hover,
.segmented-button:hover,
.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.sidebar-footer-button:hover,
.nav-button:hover {
    transform: translateY(-1px);
}

.primary-button:disabled:hover,
.secondary-button:disabled:hover,
.danger-button:disabled:hover,
.nav-button.is-locked:hover {
    transform: none;
}

.auth-form {
    display: none;
    gap: 0.85rem;
}

.auth-form.is-active {
    display: grid;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field > span {
    font-size: 0.92rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea,
.field-grid input,
.field-grid select,
.field-grid textarea,
.surface-input {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(17, 87, 108, 0.12);
    background: rgba(255, 255, 255, 0.92);
    min-height: 3rem;
    padding: 0.85rem 0.95rem;
    color: var(--text);
    outline: none;
}

.field textarea,
.surface-input.is-textarea {
    min-height: 7.5rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.surface-input:focus {
    border-color: rgba(37, 88, 200, 0.35);
    box-shadow: 0 0 0 4px rgba(37, 88, 200, 0.08);
}

.field input[type="file"]:not(.visually-hidden-file) {
    min-height: 3.65rem;
    padding: 0.55rem 0.65rem;
    border: 1px dashed rgba(15, 107, 115, 0.34);
    border-radius: 1.1rem;
    background:
        linear-gradient(135deg, rgba(238, 252, 249, 0.96) 0%, rgba(236, 245, 255, 0.94) 100%);
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 24px rgba(12, 48, 70, 0.06);
}

.field input[type="file"]:not(.visually-hidden-file)::file-selector-button {
    min-height: 2.45rem;
    margin-right: 0.85rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #0f7f8e 0%, #0f5f72 100%);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(8, 87, 112, 0.18);
}

.field input[type="file"]:not(.visually-hidden-file)::-webkit-file-upload-button {
    min-height: 2.45rem;
    margin-right: 0.85rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #0f7f8e 0%, #0f5f72 100%);
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(8, 87, 112, 0.18);
}

.field input[type="file"]:not(.visually-hidden-file):hover {
    border-color: rgba(15, 107, 115, 0.52);
    background:
        linear-gradient(135deg, rgba(229, 250, 246, 0.98) 0%, rgba(229, 240, 255, 0.96) 100%);
}

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

.shell-screen {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}

.sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(7, 27, 39, 0.38);
    backdrop-filter: blur(4px);
}

.sidebar {
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    z-index: 30;
    width: min(21rem, calc(100vw - 2rem));
    border-radius: 2rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(calc(-100% - 2rem));
    transition: transform 0.22s ease;
}

.shell-screen.is-sidebar-open .sidebar {
    transform: translateX(0);
}

.sidebar-brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(14, 107, 115, 0.12) 0%, rgba(37, 88, 200, 0.1) 100%);
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
    overflow: visible;
}

.sidebar-brand:hover {
    background: linear-gradient(135deg, rgba(14, 107, 115, 0.18) 0%, rgba(37, 88, 200, 0.14) 100%);
}

.sidebar-brand.is-pro-profile {
    border: 1px solid rgba(255, 177, 76, 0.38);
    background: linear-gradient(135deg, rgba(255, 249, 236, 0.96) 0%, rgba(231, 246, 255, 0.94) 100%);
    box-shadow: 0 16px 34px rgba(214, 122, 16, 0.16);
}

.sidebar-brand.is-pro-profile::after,
.avatar-preview.is-pro-profile::after {
    content: "PRO";
    position: absolute;
    left: 50%;
    top: -0.45rem;
    transform: translateX(-50%);
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    color: #7a4300;
    background: linear-gradient(135deg, #ffe5a8 0%, #ffb14c 100%);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 18px rgba(214, 122, 16, 0.22);
}

.sidebar-brand.is-pro-profile::after {
    content: none;
    display: none;
}

.sidebar-premium-button {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #ffb14c 0%, #0f6b73 100%);
    box-shadow: 0 14px 28px rgba(214, 122, 16, 0.18);
}

.brand-mark {
    position: relative;
    flex: 0 0 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 3.5rem;
    max-width: 3.5rem;
    aspect-ratio: 1;
    border-radius: 1.2rem;
    display: grid;
    place-items: center;
    overflow: visible;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 900;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    display: block;
}

.brand-mark .avatar-initials {
    font-size: 1.08rem;
}

.sidebar-brand.is-pro-profile .brand-mark::after {
    content: "PRO";
    position: absolute;
    left: 50%;
    top: -0.45rem;
    transform: translateX(-50%);
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    color: #7a4300;
    background: linear-gradient(135deg, #ffe5a8 0%, #ffb14c 100%);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 18px rgba(214, 122, 16, 0.22);
    z-index: 2;
}

.sidebar-brand.is-pro-profile .brand-mark,
.avatar-preview.is-pro-profile {
    position: relative;
    border-color: rgba(255, 177, 76, 0.5);
    box-shadow: 0 0 0 4px rgba(255, 177, 76, 0.16), 0 18px 36px rgba(214, 122, 16, 0.2);
}

.sidebar-nav {
    display: grid;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.2rem;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    text-align: left;
}

.nav-button .nav-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nav-button small {
    font-size: 0.77rem;
    color: inherit;
    opacity: 0.68;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.65rem;
    flex-shrink: 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 0.45rem;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(17, 87, 108, 0.24);
    border-radius: 999px;
}

.shell-main {
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0;
    min-height: 100vh;
}

.shell-header {
    border-radius: 0 0 2.3rem 2.3rem;
    padding: 1.2rem 1.5rem 2.7rem;
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #0f5a63 0%, #114f64 52%, #15315d 100%);
    box-shadow: 0 30px 56px rgba(12, 48, 70, 0.2);
}

.header-leading {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    flex: 1 1 auto;
}

.header-nav-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 0 auto;
}

.header-pro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    color: #fff6dc;
    background: linear-gradient(135deg, #ffb14c 0%, #d67a10 100%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 12px 24px rgba(214, 122, 16, 0.22);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.header-page-copy {
    display: grid;
    gap: 0.35rem;
    align-content: center;
    min-height: auto;
    flex: 1 1 auto;
}

.header-page-copy #header-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1.05;
    color: #fff;
}

.shell-header .header-subtitle {
    margin: 0;
    color: rgba(236, 245, 255, 0.8);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.15rem;
}

.menu-toggle-button {
    width: 3.2rem;
    min-width: 3.2rem;
    min-height: 3.2rem;
    padding: 0.7rem;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
}

.menu-toggle-lines {
    display: block;
    width: 100%;
    height: 0.18rem;
    border-radius: 999px;
    background: #fff;
}

.header-icon-button {
    position: relative;
    width: 3.2rem;
    min-width: 3.2rem;
    min-height: 3.2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-icon-symbol {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.header-icon-symbol svg {
    width: 100%;
    height: 100%;
    display: block;
}

.header-icon-button .badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6a7a 0%, #e63959 100%);
    color: #fff;
    font-size: 0.68rem;
    box-shadow: 0 12px 24px rgba(230, 57, 89, 0.24);
}

.view-root {
    display: grid;
    gap: 1rem;
    align-content: start;
    margin-top: 0;
    padding: 1.45rem 1.35rem 1.6rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2.2rem 2.2rem 0 0;
    box-shadow: 0 -10px 20px rgba(255, 255, 255, 0.42), 0 24px 56px rgba(12, 48, 70, 0.1);
    min-height: calc(100vh - 12rem);
    overflow-x: hidden;
}

@supports (min-height: 100dvh) {
    .app-shell,
    .auth-screen,
    .auth-panel,
    .shell-screen,
    .shell-main {
        min-height: 100dvh;
    }

    .sidebar {
        max-height: calc(100dvh - 2rem);
    }

    .view-root {
        min-height: calc(100dvh - 12rem);
    }
}

.is-standalone-pwa,
.is-standalone-pwa body,
.is-standalone-pwa .app-shell,
.is-standalone-pwa .auth-screen,
.is-standalone-pwa .shell-screen,
.is-standalone-pwa .shell-main {
    width: min(100%, var(--app-width, 100vw));
    max-width: var(--app-width, 100vw);
    overflow-x: hidden;
}

.is-standalone-pwa .app-shell,
.is-standalone-pwa .auth-screen,
.is-standalone-pwa .auth-panel,
.is-standalone-pwa .shell-screen,
.is-standalone-pwa .shell-main {
    min-height: var(--app-height, 100svh);
}

.page-section {
    display: grid;
    gap: 1rem;
    min-width: 0;
    content-visibility: auto;
    contain-intrinsic-size: 1px 960px;
}

.page-banner,
.card,
.list-card,
.panel-card {
    border-radius: 1.6rem;
    padding: 1.2rem;
}

.page-banner {
    background: linear-gradient(135deg, var(--accent-strong) 0%, #1b8ca0 100%);
    color: #fff;
    box-shadow: 0 24px 48px rgba(13, 67, 86, 0.2);
    display: none;
}

.page-banner p {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.8);
}

.card,
.list-card,
.panel-card {
    background: var(--surface);
    content-visibility: auto;
    contain: layout paint style;
    contain-intrinsic-size: 1px 320px;
}

.manager-description-card {
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(37, 88, 200, 0.14);
    background: linear-gradient(135deg, #eef7ff 0%, #e0f0ff 100%);
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.55;
}

.list-card.card-accent-teal { background: linear-gradient(135deg, #f4fcfc 0%, var(--card-teal) 100%); }
.list-card.card-accent-blue { background: linear-gradient(135deg, #f7faff 0%, var(--card-blue) 100%); }
.list-card.card-accent-orange { background: linear-gradient(135deg, #fffaf2 0%, var(--card-orange) 100%); }
.list-card.card-accent-red { background: linear-gradient(135deg, #fff6f7 0%, var(--card-red) 100%); }
.list-card.card-accent-green { background: linear-gradient(135deg, #f5fff8 0%, var(--card-green) 100%); }

.card-header,
.list-card-header,
.entity-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    flex-wrap: wrap;
    min-width: 0;
}

.card-header > div,
.list-card-header > div,
.entity-header > div {
    min-width: 0;
    max-width: 100%;
}

.compact-header {
    margin-top: 0.15rem;
    margin-bottom: -0.2rem;
}

.divider {
    width: 100%;
    height: 1px;
    margin: 0.2rem 0;
    background: rgba(17, 87, 108, 0.12);
}

.card-title,
.entity-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.muted {
    color: var(--muted);
}

.manager-description-card,
.manager-description-card p,
.card p,
.list-card p,
.panel-card p,
.muted,
.chip,
.badge,
.field > span,
.field small,
.nav-button small,
.header-subtitle,
.auth-subtitle,
.entity-title,
.card-title,
.view-title,
.section-heading h1,
.section-heading h2,
.section-heading h3 {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.chip-row,
.meta-row,
.info-grid,
.button-grid,
.toolbar-row,
.action-row,
.summary-grid,
.stat-grid,
.split-card,
.check-grid {
    display: grid;
    gap: 0.75rem;
}

.chip-row {
    grid-template-columns: repeat(auto-fit, minmax(8rem, max-content));
}

.chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: fit-content;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(17, 87, 108, 0.08);
    color: var(--text);
}

.chip.is-info,
.badge {
    background: rgba(37, 88, 200, 0.12);
    color: var(--info);
}

.chip.is-danger { background: rgba(205, 75, 92, 0.12); color: var(--danger); }
.chip.is-success { background: rgba(26, 142, 98, 0.12); color: var(--success); }
.chip.is-warning { background: rgba(214, 122, 16, 0.12); color: var(--warning); }
.badge {
    min-width: 1.75rem;
}

.toolbar-row {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.action-row {
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.compact-actions {
    grid-template-columns: repeat(auto-fit, minmax(9rem, max-content));
    align-items: start;
}

.resident-contact-actions {
    width: min(18rem, 100%);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: stretch;
}

.resident-contact-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 16rem);
    gap: 0.65rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(17, 79, 99, 0.1);
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
}

.resident-contact-panel.is-owner {
    background: linear-gradient(135deg, #fff9f1 0%, #fff1df 100%);
}

.resident-detail-action {
    width: 7rem;
    grid-template-columns: 1fr;
}

.list-card[data-resident-card-id] {
    cursor: pointer;
}

.resident-contact-actions .secondary-button,
.resident-contact-actions .primary-button {
    min-height: 2rem;
    padding: 0.45rem 0.25rem;
    font-size: 0.7rem;
    line-height: 1.15;
    text-align: center;
}

.resident-contact-panel .eyebrow {
    margin-bottom: 0.15rem;
}

.resident-contact-panel strong {
    display: block;
    font-size: 0.98rem;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.resident-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}

.resident-collection-grid .stat-card {
    padding: 0.65rem 0.7rem;
}

.resident-collection-grid .stat-card h3 {
    font-size: 0.68rem;
    margin-bottom: 0.25rem;
}

.resident-collection-grid .stat-card strong {
    font-size: 1.1rem;
}

.resident-collection-grid .stat-card p {
    display: none;
}

.stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.split-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    align-items: start;
}

.settings-stack {
    grid-template-columns: 1fr;
}

.settings-permissions-card {
    order: 1;
}

.settings-buildings-card {
    order: 2;
}

.summary-grid,
.stat-grid,
.split-card,
.card,
.list-card,
.panel-card,
.stat-card {
    min-width: 0;
    max-width: 100%;
}

.resident-dashboard-page,
.resident-dashboard-page > *,
.resident-dashboard-page .summary-grid,
.resident-dashboard-page .entity-list,
.resident-dashboard-page .card,
.resident-dashboard-page .list-card,
.resident-dashboard-page .stat-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.resident-dashboard-page .entity-header,
.resident-dashboard-page .card-header {
    min-width: 0;
    flex-wrap: wrap;
}

.resident-dashboard-page .entity-header > div,
.resident-dashboard-page .card-header > div {
    min-width: 0;
}

.resident-dashboard-page .chip-row {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.resident-dashboard-page .chip {
    width: 100%;
    max-width: 100%;
}

.resident-dashboard-page .entity-header > .chip-row {
    justify-content: end;
    grid-template-columns: repeat(auto-fit, minmax(6rem, max-content));
}

.resident-dashboard-page .entity-header > .chip-row .chip {
    width: fit-content;
    white-space: nowrap;
}

.resident-dashboard-page .dashboard-due-card {
    padding: 1rem 1.15rem;
    border-radius: 1.35rem;
}

.resident-dashboard-page .dashboard-due-card.is-overdue {
    border-color: rgba(205, 75, 92, 0.22);
}

.dashboard-due-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
}

.dashboard-due-copy {
    min-width: 0;
}

.dashboard-due-copy .muted {
    margin: 0.35rem 0 0;
}

.dashboard-due-side {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
    text-align: right;
}

.dashboard-due-side strong,
.dashboard-due-side span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    border-radius: 999px;
    font-weight: 800;
}

.dashboard-due-side strong {
    padding: 0.45rem 0.75rem;
    background: rgba(37, 88, 200, 0.11);
    color: var(--info);
    font-size: 0.86rem;
}

.dashboard-due-side span {
    padding: 0.35rem 0.65rem;
    background: rgba(205, 75, 92, 0.12);
    color: var(--danger);
    font-size: 0.72rem;
}

.premium-page {
    gap: 1.1rem;
}

.premium-banner {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.26), transparent 24rem),
        linear-gradient(135deg, #0f6b73 0%, #10253b 100%);
}

.document-archive-banner {
    background:
        radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.24), transparent 20rem),
        linear-gradient(135deg, #124f66 0%, #0f6b73 46%, #10253b 100%);
}

.premium-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.premium-plan-card,
.premium-locked-box {
    display: grid;
    gap: 0.85rem;
    padding: 1.15rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(17, 87, 108, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 247, 248, 0.88) 100%);
    box-shadow: 0 14px 34px rgba(12, 48, 70, 0.08);
}

.premium-plan-card.is-current {
    border-color: rgba(26, 142, 98, 0.28);
    background: linear-gradient(135deg, #f5fff8 0%, rgba(222, 247, 237, 0.92) 100%);
}

.premium-plan-card h3,
.premium-plan-card p,
.premium-locked-box p {
    margin: 0;
}

.premium-plan-card h3 {
    font-size: 1.25rem;
}

.premium-plan-card ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--muted);
    font-weight: 700;
}

.premium-plan-actions,
.premium-document-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.65rem;
}

.premium-feature-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.premium-feature-card {
    display: grid;
    gap: 0.9rem;
}

.premium-feature-card.is-locked {
    border-color: rgba(214, 122, 16, 0.2);
}

.premium-upload-form {
    padding-top: 0.25rem;
}

.premium-document-card .entity-header {
    align-items: center;
}

.premium-document-actions {
    min-width: min(14rem, 100%);
}

.pro-export-note {
    margin: 0.85rem 0 0;
    padding: 0.75rem 0.9rem;
    border-radius: 0.9rem;
    font-weight: 800;
    background: rgba(214, 122, 16, 0.1);
    color: var(--warning);
}

.pro-export-note.is-pro {
    background: rgba(26, 142, 98, 0.1);
    color: var(--success);
}

.admin-banner {
    background:
        radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.24), transparent 20rem),
        linear-gradient(135deg, #1e4f63 0%, #12324a 48%, #0d2531 100%);
}

.admin-request-list,
.admin-user-list {
    gap: 0.85rem;
}

.admin-user-card .entity-header,
.admin-request-card .entity-header {
    align-items: center;
}

.admin-actions {
    min-width: min(16rem, 100%);
}

.limit-note {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(214, 122, 16, 0.18);
    background: linear-gradient(135deg, rgba(255, 248, 236, 0.95) 0%, rgba(255, 240, 214, 0.8) 100%);
}

.limit-note.is-pro {
    border-color: rgba(26, 142, 98, 0.22);
    background: linear-gradient(135deg, rgba(241, 255, 248, 0.96) 0%, rgba(222, 247, 237, 0.86) 100%);
}

.limit-note p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.admin-system-grid {
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.admin-system-item {
    display: grid;
    gap: 0.35rem;
}

.admin-system-item span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-system-item strong {
    color: var(--text);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.stat-card strong,
.entity-title,
.card-title,
.page-banner p {
    overflow-wrap: anywhere;
}

.check-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.stat-card {
    border-radius: 1.4rem;
    padding: 1rem;
    border: 1px solid rgba(17, 87, 108, 0.08);
}

button.stat-card {
    appearance: none;
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

button.stat-card:hover {
    transform: translateY(-0.08rem);
    box-shadow: 0 18px 34px rgba(12, 48, 70, 0.13);
}

.stat-card.teal { background: linear-gradient(135deg, #f4fcfc 0%, var(--card-teal) 100%); }
.stat-card.blue { background: linear-gradient(135deg, #f7faff 0%, var(--card-blue) 100%); }
.stat-card.orange { background: linear-gradient(135deg, #fffaf2 0%, var(--card-orange) 100%); }
.stat-card.red { background: linear-gradient(135deg, #fff6f7 0%, var(--card-red) 100%); }
.stat-card.green { background: linear-gradient(135deg, #f5fff8 0%, var(--card-green) 100%); }

.stat-card h3,
.stat-card p {
    margin: 0;
}

.stat-card strong {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.9rem;
}

.entity-list {
    display: grid;
    gap: 0.85rem;
}

.operation-update-form {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(17, 87, 108, 0.12);
}

.operation-note {
    margin: 0.75rem 0 0;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(37, 88, 200, 0.08);
    color: var(--text);
    font-weight: 700;
}

.maintenance-photo {
    width: min(100%, 34rem);
    max-height: 22rem;
    margin-top: 0.85rem;
    border-radius: 1rem;
    object-fit: cover;
    border: 1px solid rgba(17, 87, 108, 0.12);
    box-shadow: 0 16px 32px rgba(12, 48, 70, 0.12);
}

.security-account-list {
    margin-top: 1rem;
}

.resident-filter-actions {
    grid-template-columns: minmax(0, 14rem);
}

.resident-tree {
    display: grid;
    gap: 0.85rem;
}

.resident-tree-group {
    display: grid;
    gap: 0.55rem;
    padding: 0.95rem 1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(17, 87, 108, 0.1);
    background: rgba(248, 252, 255, 0.92);
}

.resident-tree-group-button,
.resident-tree-unit {
    appearance: none;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.resident-tree-group-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
    background: transparent;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
}

.resident-tree-group-button small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.resident-tree-group-button.is-active {
    color: var(--accent-strong);
}

.resident-tree-units {
    display: grid;
    gap: 0.55rem;
    padding-left: 0.85rem;
}

.resident-tree-unit {
    padding: 0.7rem 0.9rem;
    border-radius: 0.95rem;
    background: rgba(231, 240, 255, 0.9);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.resident-tree-unit:hover,
.resident-tree-unit.is-active {
    transform: translateX(0.15rem);
    background: rgba(37, 88, 200, 0.15);
    color: var(--info);
}

.empty-state {
    padding: 1.4rem;
    border-radius: 1.2rem;
    background: rgba(17, 87, 108, 0.05);
    color: var(--muted);
    text-align: center;
}

.hero-value {
    font-size: 2.3rem;
    font-weight: 900;
}

.stack {
    display: grid;
    gap: 0.85rem;
}

.inline-fields {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.phone-entry-grid {
    grid-template-columns: minmax(5.8rem, 6.8rem) minmax(0, 1fr);
    align-items: end;
}

.field-country-code {
    min-width: 0;
}

.field-country-code select {
    text-align: center;
}

.owner-fields {
    display: grid;
    gap: 0.75rem;
}

.avatar-stack {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.account-profile-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 248, 255, 0.92) 100%);
}

.account-avatar-stack {
    align-items: center;
    justify-content: space-between;
}

.account-profile-copy {
    display: grid;
    gap: 0.65rem;
    flex: 1 1 16rem;
    min-width: min(100%, 14rem);
}

.account-avatar-actions {
    justify-content: flex-start;
}

.avatar-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.visually-hidden-file {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.avatar-preview {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 1.4rem;
    display: grid;
    place-items: center;
    overflow: visible;
    background: linear-gradient(135deg, #d8f2ee 0%, #bce7f3 100%);
    border: 1px solid rgba(17, 87, 108, 0.12);
}

.avatar-preview img {
    width: calc(100% - 0.35rem);
    height: calc(100% - 0.35rem);
    object-fit: contain;
    border-radius: inherit;
    display: block;
    background: rgba(255, 255, 255, 0.92);
}

.avatar-initials {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-weight: 900;
    font-size: 1.45rem;
    line-height: 1;
}

.avatar-crop-tool {
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.avatar-crop-frame {
    position: relative;
    width: min(18rem, 74vw);
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 1.4rem;
    border: 1px solid rgba(17, 87, 108, 0.2);
    background:
        linear-gradient(45deg, rgba(17, 87, 108, 0.08) 25%, transparent 25% 75%, rgba(17, 87, 108, 0.08) 75%),
        linear-gradient(45deg, rgba(17, 87, 108, 0.08) 25%, transparent 25% 75%, rgba(17, 87, 108, 0.08) 75%);
    background-position: 0 0, 0.55rem 0.55rem;
    background-size: 1.1rem 1.1rem;
    box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.08);
    cursor: grab;
    touch-action: none;
}

.avatar-crop-frame:active {
    cursor: grabbing;
}

.avatar-crop-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 0 0 1px rgba(17, 87, 108, 0.18);
    border-radius: inherit;
    pointer-events: none;
}

.avatar-crop-image {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: none;
    user-select: none;
    will-change: width, height, transform;
}

.avatar-crop-slider {
    width: min(18rem, 100%);
}

.avatar-crop-slider input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

.permission-grid {
    display: grid;
    gap: 0.85rem;
}

.permission-card {
    padding: 1rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(17, 87, 108, 0.1);
    background: rgba(255, 255, 255, 0.85);
}

.permission-card h4 {
    margin: 0 0 0.25rem;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(17, 87, 108, 0.08);
}

.switch-row:first-of-type {
    border-top: 0;
}

.switch-row input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(7, 27, 39, 0.48);
    backdrop-filter: blur(6px);
}

.modal-panel {
    width: min(96vw, 60rem);
    max-height: min(90vh, 60rem);
    overflow: auto;
    border-radius: 1.8rem;
    padding: 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.65rem;
}

.modal-body {
    display: grid;
    gap: 1rem;
}

.icon-button {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    background: rgba(17, 87, 108, 0.08);
    color: var(--text);
    font-size: 1.7rem;
    line-height: 1;
}

.toast-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: grid;
    gap: 0.75rem;
}

.toast {
    min-width: min(22rem, 92vw);
    max-width: 26rem;
    padding: 0.9rem 1rem;
    border-radius: 1.1rem;
    background: rgba(16, 37, 59, 0.94);
    color: #fff;
    box-shadow: 0 18px 48px rgba(7, 27, 39, 0.28);
}

.toast.is-error { background: rgba(153, 33, 62, 0.96); }
.toast.is-success { background: rgba(22, 106, 79, 0.96); }

.loading-state {
    display: grid;
    place-items: center;
    min-height: 14rem;
    color: var(--muted);
}

.loading-card {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
    padding: 1.35rem 1.5rem;
    border-radius: 1.3rem;
    border: 1px solid rgba(17, 87, 108, 0.1);
    background: rgba(255, 255, 255, 0.88);
    text-align: center;
}

.loading-card strong,
.loading-card p {
    margin: 0;
}

.loading-spinner {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    border: 0.2rem solid rgba(17, 87, 108, 0.14);
    border-top-color: var(--accent);
    animation: siteyonetim-spin 0.8s linear infinite;
}

@keyframes siteyonetim-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .auth-panel,
    .split-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    html,
    body,
    .app-shell,
    .auth-screen,
    .shell-screen,
    .shell-main,
    .view-root {
        width: 100%;
        max-width: 100%;
    }

    .auth-panel,
    .shell-screen {
        padding: 0;
    }

    .auth-panel {
        width: 100%;
        max-width: 100%;
        min-height: 100svh;
        padding-left: max(0.85rem, env(safe-area-inset-left));
        padding-right: max(0.85rem, env(safe-area-inset-right));
    }

    .auth-card,
    .page-section,
    .page-banner,
    .card,
    .list-card,
    .panel-card {
        max-width: 100%;
    }

    .account-avatar-stack {
        justify-content: center;
        text-align: center;
    }

    .account-profile-copy {
        justify-items: center;
    }

    .account-avatar-actions {
        justify-content: center;
    }

    .auth-card,
    .auth-hero-card,
    .sidebar,
    .shell-header,
    .card,
    .list-card,
    .panel-card,
    .modal-panel {
        border-radius: 1.35rem;
    }

    .field-grid,
    .toolbar-row,
    .action-row,
    .summary-grid,
    .stat-grid,
    .check-grid,
    .premium-feature-layout,
    .inline-fields {
        grid-template-columns: 1fr;
    }

    .phone-entry-grid {
        grid-template-columns: minmax(5.4rem, 6.4rem) minmax(0, 1fr);
    }

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

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

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

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

    .resident-collection-grid .stat-card {
        padding: 0.7rem 0.55rem;
    }

    .resident-collection-grid .stat-card h3 {
        font-size: 0.68rem;
    }

    .resident-collection-grid .stat-card strong {
        font-size: 1rem;
    }

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

    .resident-tree-group {
        padding: 0.85rem 0.9rem;
    }

    .shell-header {
        align-items: start;
        flex-direction: column;
        padding: 1rem 1rem 1.55rem;
        gap: 0.85rem;
        position: relative;
    }

    .header-leading {
        width: 100%;
        gap: 0.8rem;
        align-items: stretch;
    }

    .header-actions {
        width: auto;
        justify-content: flex-end;
        align-self: auto;
        gap: 0.6rem;
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 1;
    }

    .header-leading {
        flex-direction: column;
    }

    .header-nav-row {
        gap: 0.55rem;
        flex-wrap: wrap;
    }

    .header-page-copy {
        width: 100%;
        min-height: auto;
        align-content: start;
        padding-right: 3.35rem;
        gap: 0.2rem;
    }

    .header-page-copy #header-title {
        font-size: clamp(1.65rem, 8vw, 2.05rem);
    }

    .shell-header .header-subtitle {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .menu-toggle-button,
    .header-icon-button {
        width: 2.8rem;
        min-width: 2.8rem;
        min-height: 2.8rem;
    }

    .header-icon-symbol {
        width: 1.15rem;
        height: 1.15rem;
    }

    .view-root {
        padding: 1.1rem 1rem 1.35rem;
        min-height: calc(100vh - 10.5rem);
    }

    .auth-hero-card,
    .auth-card,
    .sidebar,
    .modal-panel,
    .list-card,
    .panel-card,
    .card,
    .shell-header {
        box-shadow: 0 12px 24px rgba(12, 48, 70, 0.1);
    }

    .auth-hero-card,
    .auth-card,
    .sidebar,
    .modal-panel {
        backdrop-filter: none;
    }

    .resident-dashboard-page .chip-row {
        grid-template-columns: 1fr;
    }
}

.resident-dashboard-page .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card {
    display: grid;
    gap: 0.9rem;
}

.cash-ledger-page .cash-filter-card .toolbar-row {
    align-items: end;
}

.cash-export-actions {
    align-self: end;
}

.cash-report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

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

.cash-ledger-card .entity-header {
    align-items: start;
}

.cash-ledger-card .hero-value {
    white-space: nowrap;
}

.metric-bars {
    display: grid;
    gap: 0.75rem;
}

.metric-bar-item {
    display: grid;
    gap: 0.35rem;
}

.metric-bar-copy {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.metric-bar-copy strong {
    font-size: 0.95rem;
}

.metric-bar-copy span {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.88rem;
}

.metric-bar-track {
    width: 100%;
    height: 0.8rem;
    border-radius: 999px;
    background: rgba(17, 87, 108, 0.08);
    overflow: hidden;
}

.metric-bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.metric-bar-fill.teal { background: linear-gradient(135deg, #1b8ca0 0%, #0f6b73 100%); }
.metric-bar-fill.blue { background: linear-gradient(135deg, #5a87f6 0%, #2558c8 100%); }
.metric-bar-fill.orange { background: linear-gradient(135deg, #ffb14c 0%, #d67a10 100%); }
.metric-bar-fill.red { background: linear-gradient(135deg, #ff7f90 0%, #cd4b5c 100%); }
.metric-bar-fill.green { background: linear-gradient(135deg, #3ecf8e 0%, #1a8e62 100%); }

@media (display-mode: standalone) and (max-width: 720px) {
    .app-shell,
    .auth-screen,
    .auth-panel,
    .shell-screen,
    .shell-main {
        min-height: var(--app-height, 100svh);
    }

    .auth-panel {
        gap: 1.15rem;
        padding-top: max(1.1rem, env(safe-area-inset-top) + 0.45rem);
        padding-bottom: max(0.85rem, env(safe-area-inset-bottom) + 0.65rem);
    }

    .auth-hero {
        gap: 0.75rem;
        padding-top: max(1.15rem, env(safe-area-inset-top) + 0.5rem);
    }

    .auth-logo {
        width: min(100%, 18rem);
    }

    .auth-subtitle {
        max-width: 17.5rem;
        font-size: 0.95rem;
        line-height: 1.38;
    }

    .auth-card {
        padding: 1.05rem 0.95rem 1rem;
        border-radius: 1.45rem;
        gap: 0.9rem;
    }

    .auth-heading h1 {
        font-size: 1.75rem;
    }

    .auth-tabs {
        gap: 0.5rem;
    }

    .auth-tabs .tab-button {
        min-height: 4.15rem;
        padding: 0.65rem 0.35rem;
        border-radius: 1rem;
    }

    .input-shell,
    .input-shell input,
    .auth-card .field > input,
    .auth-card .field > select,
    .auth-card .field > textarea {
        min-height: 3.15rem;
    }

    .auth-submit-button {
        min-height: 3.35rem;
    }

    .shell-header {
        padding: 0.78rem 0.75rem 1.08rem;
        border-radius: 0 0 1.35rem 1.35rem;
        gap: 0.65rem;
    }

    .header-nav-row {
        gap: 0.45rem;
    }

    .menu-toggle-button,
    .header-icon-button {
        width: 2.45rem;
        min-width: 2.45rem;
        min-height: 2.45rem;
        border-radius: 0.85rem;
    }

    .header-page-copy {
        padding-right: 2.9rem;
    }

    .header-page-copy #header-title {
        font-size: 1.35rem;
    }

    .shell-header .header-subtitle {
        font-size: 0.8rem;
        line-height: 1.28;
    }

    .view-root {
        padding: 0.75rem 0.7rem 1rem;
        min-height: calc(var(--app-height, 100svh) - 8.45rem);
        border-radius: 1.35rem 1.35rem 0 0;
    }

    .page-section {
        gap: 0.75rem;
    }

    .page-banner,
    .card,
    .list-card,
    .panel-card {
        padding: 0.9rem;
        border-radius: 1.05rem;
    }

    .summary-grid,
    .stat-grid,
    .check-grid,
    .premium-plan-grid {
        gap: 0.65rem;
    }

    .resident-dashboard-page {
        overflow-x: hidden;
    }

    .resident-dashboard-page .card,
    .resident-dashboard-page .list-card,
    .resident-dashboard-page .stat-card {
        overflow: hidden;
    }
}

@media (max-width: 720px) {
    .cash-report-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-due-main {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .dashboard-due-side {
        justify-items: start;
        text-align: left;
        grid-template-columns: repeat(2, max-content);
    }

    .cash-ledger-card .entity-header {
        grid-template-columns: 1fr;
    }

    .cash-ledger-card .hero-value {
        justify-self: start;
    }
}

@supports (min-height: 100dvh) {
    @media (max-width: 720px) {
        .view-root {
            min-height: calc(100dvh - 10.5rem);
        }
    }
}

@media (orientation: landscape) and (max-height: 720px) {
    .sidebar {
        top: 0.5rem;
        left: 0.5rem;
        bottom: 0.5rem;
        width: min(19.5rem, calc(100vw - 1rem));
        max-height: calc(100vh - 1rem);
        padding: 0.9rem;
        border-radius: 1.35rem;
        gap: 0.75rem;
    }

    .sidebar-brand {
        padding: 0.8rem;
    }

    .brand-mark {
        flex-basis: 2.9rem;
        width: 2.9rem;
        height: 2.9rem;
        min-width: 2.9rem;
        max-width: 2.9rem;
        border-radius: 1rem;
        font-size: 1.05rem;
    }

    .sidebar-nav {
        overflow: visible;
    }

    .nav-button {
        padding: 0.8rem 0.9rem;
    }

    .nav-button small {
        font-size: 0.72rem;
    }

    .sidebar-footer {
        margin-top: 0;
    }
}

@media (max-width: 430px) {
    .shell-header {
        padding: 0.9rem 0.85rem 1.35rem;
        border-radius: 0 0 1.65rem 1.65rem;
    }

    .header-page-copy #header-title {
        font-size: 1.5rem;
    }

    .shell-header .header-subtitle {
        font-size: 0.86rem;
    }

    .header-actions {
        top: 0.9rem;
        right: 0.85rem;
    }

    .view-root {
        padding: 0.95rem 0.8rem 1.2rem;
    }
}

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

/* Auth refresh */
.auth-screen {
    min-height: 100vh;
}

.auth-backdrop {
    background:
        radial-gradient(circle at 12% 12%, rgba(76, 142, 255, 0.18), transparent 24rem),
        radial-gradient(circle at 88% 14%, rgba(13, 115, 133, 0.12), transparent 22rem),
        linear-gradient(180deg, #f8fbff 0%, #eef5fd 52%, #e5effb 100%);
}

.auth-cityline {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 9.5rem;
    pointer-events: none;
    opacity: 0.3;
    background:
        linear-gradient(180deg, rgba(229, 239, 251, 0) 0%, rgba(214, 227, 243, 0.74) 100%),
        linear-gradient(90deg,
            transparent 0 5%,
            rgba(168, 190, 214, 0.18) 5% 8%,
            transparent 8% 11%,
            rgba(168, 190, 214, 0.18) 11% 15%,
            transparent 15% 24%,
            rgba(168, 190, 214, 0.2) 24% 31%,
            transparent 31% 38%,
            rgba(168, 190, 214, 0.14) 38% 44%,
            transparent 44% 57%,
            rgba(168, 190, 214, 0.18) 57% 63%,
            transparent 63% 71%,
            rgba(168, 190, 214, 0.14) 71% 76%,
            transparent 76% 100%);
}

.auth-panel {
    width: min(100%, 35rem);
    max-width: 100vw;
    margin-inline: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: max(2rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom) + 1rem);
    align-content: start;
    justify-items: stretch;
}

.auth-hero {
    gap: 1.15rem;
    justify-items: center;
    padding-top: clamp(3rem, 12vh, 7rem);
}

.auth-brand-lockup {
    width: min(100%, 30rem);
}

.auth-logo {
    display: block;
    width: min(100%, 31rem);
    margin-inline: auto;
    filter: drop-shadow(0 18px 30px rgba(26, 73, 131, 0.08));
}

.auth-subtitle {
    max-width: 24rem;
    font-size: clamp(1rem, 2.8vw, 1.15rem);
    line-height: 1.5;
    color: #57728f;
}

.auth-card {
    position: relative;
    width: min(100%, calc(100vw - 2rem));
    justify-self: center;
    border-radius: 2.35rem;
    padding: 1.8rem;
    gap: 1.2rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(161, 188, 216, 0.38);
    box-shadow: 0 26px 60px rgba(37, 78, 133, 0.14);
}

.auth-heading {
    text-align: center;
    gap: 0.45rem;
}

.auth-heading h1 {
    color: #0d315e;
    font-size: clamp(2rem, 6vw, 2.55rem);
}

.auth-context-note {
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 1rem;
    background: rgba(236, 245, 255, 0.86);
    color: #42607d;
    font-size: 0.96rem;
    line-height: 1.45;
}

.status-pill {
    border: 1px solid rgba(17, 116, 132, 0.12);
    background: #dff9f2;
    color: #0f7585;
}

.status-pill.is-error {
    background: #fff1f3;
    border-color: rgba(193, 68, 92, 0.14);
    color: #c1445c;
}

.auth-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    min-width: 0;
}

.auth-tabs .tab-button {
    min-width: 0;
    min-height: 5.2rem;
    display: grid;
    place-items: center;
    gap: 0.55rem;
    padding: 0.95rem 0.7rem;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(247, 250, 254, 0.96) 0%, rgba(239, 244, 250, 0.92) 100%);
    color: #4d667f;
    box-shadow: inset 0 0 0 1px rgba(182, 198, 220, 0.18);
}

.auth-tabs .tab-button.is-active {
    background: linear-gradient(135deg, #0f869a 0%, #095c76 100%);
    color: #fff;
    box-shadow: 0 18px 34px rgba(8, 87, 112, 0.26);
}

.auth-tab-icon,
.auth-tab-icon svg {
    width: 1.55rem;
    height: 1.55rem;
}

.auth-tabs .tab-button span:last-child {
    font-size: 0.95rem;
}

.auth-form {
    gap: 1rem;
}

.auth-card .field {
    gap: 0.6rem;
}

.auth-card .field > span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #4e6881;
}

.input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 3.6rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(177, 194, 214, 0.58);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.input-shell:focus-within {
    border-color: rgba(37, 88, 200, 0.32);
    box-shadow: 0 0 0 4px rgba(37, 88, 200, 0.08);
}

.input-shell.has-action {
    grid-template-columns: minmax(0, 1fr) auto;
}

.input-shell.has-action:has(.input-leading-icon) {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.input-leading-icon,
.input-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #66809a;
}

.input-leading-icon {
    width: 3.2rem;
    height: 100%;
}

.input-leading-icon svg,
.input-action-button svg {
    width: 1.35rem;
    height: 1.35rem;
}

.input-action-button {
    width: 3.1rem;
    height: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.input-shell input {
    min-width: 0;
    min-height: 3.6rem;
    padding: 0 0.95rem 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.input-shell.has-action input {
    padding-left: 1rem;
}

.auth-card .field > input,
.auth-card .field > select,
.auth-card .field > textarea {
    min-height: 3.55rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(177, 194, 214, 0.58);
    background: rgba(255, 255, 255, 0.98);
}

.input-action-button.is-active {
    color: #0f869a;
}

.auth-inline-helper {
    margin: -0.2rem 0 0;
    color: #69829a;
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-submit-button {
    min-height: 4rem;
    padding-inline: 1.45rem;
    border-radius: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, #0f869a 0%, #07596e 100%);
    box-shadow: 0 18px 34px rgba(8, 87, 112, 0.24);
}

.auth-submit-button span:first-child {
    font-size: 1.05rem;
    font-weight: 800;
}

.auth-submit-icon,
.auth-submit-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.auth-footnote {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    margin-top: 0.35rem;
    color: #607a93;
}

.auth-footnote-icon {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eefcf9 0%, #e3f4f2 100%);
    color: #0f869a;
}

.auth-footnote-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.auth-footnote strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #4a647c;
}

.auth-footnote p {
    margin: 0;
    line-height: 1.5;
}

@media (min-width: 900px) {
    .auth-panel {
        width: min(100%, 42rem);
        padding-inline: 1.5rem;
    }

    .auth-card {
        padding: 2.3rem;
    }
}

@media (max-width: 720px) {
    .auth-panel {
        width: 100%;
        max-width: 100%;
        min-height: 100svh;
        gap: 1.6rem;
        padding-left: max(0.85rem, env(safe-area-inset-left));
        padding-right: max(0.85rem, env(safe-area-inset-right));
    }

    .auth-hero {
        padding-top: max(2.35rem, env(safe-area-inset-top) + 0.8rem);
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
        border-radius: 2rem;
        padding: 1.4rem 1.2rem 1.35rem;
    }

    .auth-tabs {
        gap: 0.65rem;
    }

    .auth-tabs .tab-button {
        min-height: 4.85rem;
        padding-inline: 0.45rem;
    }
}

@media (max-width: 480px) {
    .auth-panel {
        width: 100%;
    }

    .auth-logo {
        width: min(100%, 22rem);
    }

    .auth-subtitle {
        max-width: 18.5rem;
    }

    .field-grid,
    .inline-fields {
        grid-template-columns: 1fr;
    }
}

@media (display-mode: standalone) and (max-width: 720px) {
    html,
    body,
    .app-shell,
    .auth-screen,
    .auth-panel,
    .shell-screen,
    .shell-main {
        width: min(100%, var(--app-width, 100vw));
        max-width: var(--app-width, 100vw);
        min-height: var(--app-height, 100svh);
        overflow-x: hidden;
    }

    .auth-panel {
        gap: 1.15rem;
        padding: max(1.1rem, env(safe-area-inset-top) + 0.45rem) max(0.85rem, env(safe-area-inset-right)) max(0.85rem, env(safe-area-inset-bottom) + 0.65rem) max(0.85rem, env(safe-area-inset-left));
    }

    .auth-hero {
        gap: 0.75rem;
        padding-top: max(1.15rem, env(safe-area-inset-top) + 0.5rem);
    }

    .auth-logo {
        width: min(100%, 18rem);
    }

    .auth-subtitle {
        max-width: 17.5rem;
        font-size: 0.95rem;
        line-height: 1.38;
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
        padding: 1.05rem 0.95rem 1rem;
        border-radius: 1.45rem;
        gap: 0.9rem;
    }

    .auth-heading h1 {
        font-size: 1.75rem;
    }

    .auth-tabs {
        gap: 0.5rem;
    }

    .auth-tabs .tab-button {
        min-height: 4.15rem;
        padding: 0.65rem 0.35rem;
        border-radius: 1rem;
    }

    .input-shell,
    .input-shell input,
    .auth-card .field > input,
    .auth-card .field > select,
    .auth-card .field > textarea {
        min-height: 3.15rem;
    }

    .auth-submit-button {
        min-height: 3.35rem;
    }

    .shell-header {
        padding: 0.78rem 0.75rem 1.08rem;
        border-radius: 0 0 1.35rem 1.35rem;
        gap: 0.65rem;
    }

    .header-nav-row {
        gap: 0.45rem;
    }

    .menu-toggle-button,
    .header-icon-button {
        width: 2.45rem;
        min-width: 2.45rem;
        min-height: 2.45rem;
        border-radius: 0.85rem;
    }

    .header-page-copy {
        padding-right: 2.9rem;
    }

    .header-page-copy #header-title {
        font-size: 1.35rem;
    }

    .shell-header .header-subtitle {
        font-size: 0.8rem;
        line-height: 1.28;
    }

    .view-root {
        padding: 0.75rem 0.7rem 1rem;
        min-height: calc(var(--app-height, 100svh) - 8.45rem);
        border-radius: 1.35rem 1.35rem 0 0;
    }

    .page-section {
        gap: 0.75rem;
    }

    .page-banner,
    .card,
    .list-card,
    .panel-card {
        padding: 0.9rem;
        border-radius: 1.05rem;
    }

    .summary-grid,
    .stat-grid,
    .check-grid,
    .premium-plan-grid {
        gap: 0.65rem;
    }
}
