:root {
    --app-bg: #f4f3ee;
    --app-surface: rgba(255, 255, 255, 0.92);
    --app-surface-strong: #ffffff;
    --app-surface-soft: #eef5f2;
    --app-border: #d6e5de;
    --app-text: #18312b;
    --app-muted: #62756d;
    --app-primary: #0f766e;
    --app-primary-deep: #11514c;
    --app-secondary: #e7b46b;
    --app-danger: #b95555;
    --app-warning: #d08b2d;
    --app-success: #2f855a;
    --app-shadow: 0 24px 60px rgba(18, 49, 43, 0.1);
    --app-radius: 24px;
}

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

html {
    min-height: 100%;
}

body.app-body,
body.auth-body {
    margin: 0;
    color: var(--app-text);
    background:
        radial-gradient(circle at top left, rgba(231, 180, 107, 0.22), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 32%),
        linear-gradient(180deg, #f8f7f3 0%, #eff4ef 100%);
    font-family: 'Manrope', sans-serif;
    min-height: 100vh;
}

a {
    color: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 280px;
    background:
        linear-gradient(180deg, rgba(17, 81, 76, 0.97) 0%, rgba(14, 50, 47, 0.98) 100%),
        #103532;
    color: #f9fbfa;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-brand {
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.app-brand-mark {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    padding: 6px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
}

.app-brand-name {
    display: block;
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    line-height: 1.1;
}

.app-brand-tag {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: 0.02em;
}

.app-nav {
    display: grid;
    gap: 8px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.app-nav-link:hover,
.app-nav-link.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(2px);
}

.app-sidebar-footer {
    margin-top: auto;
}

.app-company-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-company-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.68);
}

.app-company-card strong,
.app-company-card small {
    display: block;
}

.app-company-card small {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.75);
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 22px 28px 32px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.app-topbar-toggle {
    display: none;
    color: var(--app-text);
    background: var(--app-surface);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: var(--app-shadow);
}

.app-topbar-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-topbar-company {
    font-weight: 700;
    font-size: 1rem;
}

.app-topbar-role {
    color: var(--app-muted);
    font-size: 0.88rem;
}

.app-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.app-inline-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 600;
}

.app-alert-inbox-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-alert-inbox-count {
    position: absolute;
    top: -9px;
    right: -12px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, #d94c4c 0%, #b73535 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(183, 53, 53, 0.24);
}

.app-content {
    max-width: 1440px;
}

.app-page-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    padding: 30px 32px;
    border-radius: 30px;
    background:
        radial-gradient(circle at right top, rgba(231, 180, 107, 0.32), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(240, 246, 243, 0.96) 100%);
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: var(--app-shadow);
}

.app-page-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    color: var(--app-primary);
    font-weight: 800;
}

.app-page-title {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.02;
}

.app-page-subtitle {
    margin: 10px 0 0;
    max-width: 760px;
    color: var(--app-muted);
    font-size: 1rem;
}

.app-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.app-alert {
    border: none;
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 18px;
}

.app-grid {
    display: grid;
    gap: 18px;
}

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

.app-grid.two-column {
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.app-grid.three-column {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.panel-card,
.metric-card,
.resident-card,
.timeline-card,
.summary-card,
.table-card,
.empty-state,
.auth-card,
.auth-visual {
    background: var(--app-surface);
    border: 1px solid rgba(15, 118, 110, 0.1);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(10px);
}

.metric-card,
.summary-card,
.panel-card,
.table-card {
    padding: 22px;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: auto -22px -28px auto;
    width: 108px;
    height: 108px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.12) 0%, transparent 70%);
}

.metric-card.metric-card-danger::after {
    background: radial-gradient(circle, rgba(185, 85, 85, 0.18) 0%, transparent 70%);
}

.metric-card.metric-card-warning::after {
    background: radial-gradient(circle, rgba(208, 139, 45, 0.2) 0%, transparent 70%);
}

.metric-card.metric-card-danger .metric-value {
    color: var(--app-danger);
}

.metric-card.metric-card-warning .metric-value {
    color: var(--app-warning);
}

.metric-label {
    display: block;
    margin-bottom: 8px;
    color: var(--app-muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-value {
    display: block;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 800;
}

.metric-meta {
    display: block;
    margin-top: 10px;
    color: var(--app-muted);
    font-size: 0.92rem;
}

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

.section-heading h2,
.section-heading h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.section-heading p {
    margin: 0;
    color: var(--app-muted);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.form-control,
.custom-select,
textarea.form-control {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
    border: 1.75px solid rgba(15, 118, 110, 0.2);
    color: #173554;
    background-color: rgba(255, 255, 255, 0.96);
    padding: 13px 16px;
    line-height: 1.38;
    box-shadow: 0 6px 16px rgba(18, 49, 43, 0.03);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.form-control:focus,
.custom-select:focus,
textarea.form-control:focus {
    border-color: rgba(44, 105, 207, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(44, 105, 207, 0.12);
    color: #173554;
    background-color: #ffffff;
}

.custom-select {
    height: auto;
    padding-right: 46px;
    padding-top: 13px;
    padding-bottom: 13px;
    background-position: right 16px center;
    background-size: 10px 12px;
    white-space: normal;
    text-overflow: ellipsis;
}

.custom-select option {
    color: #173554;
}

.filter-bar .form-control,
.filter-bar .custom-select {
    flex: 1 1 240px;
    min-width: 240px;
    max-width: none;
}

.filter-bar.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: end;
}

.filter-bar.filter-grid > .btn,
.filter-bar.filter-grid > a.btn {
    min-height: 52px;
}

.detail-grid {
    display: grid;
    gap: 16px;
}

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

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

.resident-card {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.resident-card.is-due-now,
.medication-alert-card.is-due-now {
    border-color: rgba(185, 85, 85, 0.34);
    box-shadow: 0 22px 44px rgba(185, 85, 85, 0.12);
}

.resident-card.is-upcoming,
.medication-alert-card.is-upcoming {
    border-color: rgba(208, 139, 45, 0.34);
    box-shadow: 0 22px 44px rgba(208, 139, 45, 0.12);
}

.resident-card.is-due-now::before,
.resident-card.is-upcoming::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    border-radius: 999px;
}

.resident-card.is-due-now::before {
    background: linear-gradient(180deg, rgba(185, 85, 85, 0.92), rgba(185, 85, 85, 0.28));
}

.resident-card.is-upcoming::before {
    background: linear-gradient(180deg, rgba(208, 139, 45, 0.92), rgba(208, 139, 45, 0.28));
}

.resident-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.resident-avatar {
    width: 62px;
    height: 62px;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(231, 180, 107, 0.22));
    padding: 4px;
}

.resident-card h3,
.resident-card h4 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.resident-priority-banner {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 12px;
    margin-bottom: 14px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.resident-priority-banner.success {
    background: rgba(47, 133, 90, 0.12);
    color: var(--app-success);
}

.resident-priority-banner.warning {
    background: rgba(208, 139, 45, 0.16);
    color: var(--app-warning);
}

.resident-priority-banner.danger {
    background: rgba(185, 85, 85, 0.14);
    color: var(--app-danger);
}

.resident-priority-banner.info {
    background: rgba(15, 118, 110, 0.12);
    color: var(--app-primary);
}

.resident-meta,
.muted-copy,
.panel-copy,
.list-meta {
    color: var(--app-muted);
}

.resident-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 8px;
    font-size: 0.88rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}

.medication-alert-board {
    position: relative;
    overflow: hidden;
}

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

.medication-alert-card {
    position: relative;
    padding: 20px;
    border-radius: calc(var(--app-radius) - 2px);
    border: 1px solid rgba(15, 118, 110, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 250, 0.98)),
        var(--app-surface);
}

.medication-alert-card h3 {
    margin: 6px 0 0;
    font-size: 1.04rem;
    font-weight: 800;
}

.medication-alert-eyebrow {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--app-muted);
}

.medication-alert-copy {
    margin: 10px 0 0;
    color: var(--app-muted);
}

.medication-alert-empty {
    padding: 10px 0 2px;
    color: var(--app-muted);
}

.oversight-board,
.incident-watch {
    position: relative;
    overflow: hidden;
}

.oversight-board::after,
.incident-watch::after {
    content: '';
    position: absolute;
    inset: auto -40px -40px auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(44, 105, 207, 0.12) 0%, transparent 72%);
    pointer-events: none;
}

.incident-watch.is-urgent {
    border-color: rgba(185, 85, 85, 0.22);
    box-shadow: 0 24px 60px rgba(185, 85, 85, 0.12);
}

.oversight-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.oversight-metric {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(242, 247, 252, 0.96), rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(44, 105, 207, 0.12);
}

.oversight-metric strong {
    font-size: 1.8rem;
    line-height: 1;
    color: #1c4b74;
}

.oversight-metric span:last-child {
    color: var(--app-muted);
    font-size: 0.88rem;
}

.oversight-metric-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 800;
    color: #4c78a7;
}

.oversight-story {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.oversight-story-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(246, 250, 253, 0.96);
    border: 1px solid rgba(44, 105, 207, 0.1);
}

.oversight-story-item strong {
    color: #1b4d75;
}

.oversight-story-item span {
    color: var(--app-muted);
}

.oversight-story-item.is-calm {
    background: rgba(242, 248, 245, 0.96);
    border-color: rgba(47, 133, 90, 0.14);
}

.oversight-list-item {
    align-items: center;
}

.incident-list-item {
    border-left: 4px solid transparent;
}

.incident-tone-danger {
    border-left-color: rgba(185, 85, 85, 0.78);
    background: linear-gradient(180deg, rgba(255, 247, 247, 0.98), rgba(255, 255, 255, 0.96));
}

.incident-tone-warning {
    border-left-color: rgba(208, 139, 45, 0.78);
    background: linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(255, 255, 255, 0.96));
}

.app-chip,
.status-pill,
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.app-chip {
    background: rgba(15, 118, 110, 0.1);
    color: var(--app-primary);
}

.role-pill {
    background: rgba(24, 49, 43, 0.08);
    color: var(--app-text);
}

.status-pill.success {
    background: rgba(47, 133, 90, 0.12);
    color: var(--app-success);
}

.status-pill.warning {
    background: rgba(208, 139, 45, 0.14);
    color: var(--app-warning);
}

.status-pill.danger {
    background: rgba(185, 85, 85, 0.14);
    color: var(--app-danger);
}

.status-pill.info {
    background: rgba(15, 118, 110, 0.12);
    color: var(--app-primary);
}

.status-pill.prompt-orange {
    background: rgba(217, 124, 38, 0.16);
    color: #b55e11;
}

.status-pill.prompt-yellow {
    background: rgba(232, 187, 66, 0.2);
    color: #8c6a08;
}

.resident-actions,
.card-actions,
.stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stack-actions form {
    margin: 0;
}

.resident-actions {
    margin-top: 18px;
}

.card-copy {
    color: var(--app-muted);
    margin-bottom: 0;
}

.timeline-list,
.activity-feed {
    display: grid;
    gap: 14px;
}

.timeline-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.timeline-tile {
    position: relative;
    min-height: 150px;
    padding: 12px 10px;
    border: 1px solid rgba(57, 90, 132, 0.12);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(44, 105, 207, 0.1), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    box-shadow: 0 16px 28px rgba(23, 53, 84, 0.07);
    color: var(--app-text);
    text-align: center;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    text-decoration: none;
}

.timeline-tile:hover,
.timeline-tile:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(15, 118, 110, 0.24);
    box-shadow: 0 22px 34px rgba(23, 53, 84, 0.1);
    outline: none;
}

.timeline-tile-time,
.timeline-tile-author {
    position: absolute;
    top: 9px;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--app-primary);
    font-size: 0.66rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(23, 53, 84, 0.08);
}

.timeline-tile-time {
    left: 9px;
}

.timeline-tile-author {
    right: 9px;
}

.timeline-tile-icon {
    width: 46px;
    height: 46px;
    margin: 18px auto 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--app-primary);
}

.timeline-tile-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.timeline-tile-icon i {
    font-size: 1.35rem;
}

.timeline-tile-title,
.timeline-tile-meta {
    display: block;
}

.timeline-tile-title {
    min-height: 34px;
    font-size: 0.76rem;
    line-height: 1.2;
    font-weight: 800;
}

.timeline-tile-meta {
    margin-top: 5px;
    color: var(--app-muted);
    font-size: 0.66rem;
    line-height: 1.2;
}

.timeline-tile .status-pill {
    margin-top: 8px;
    font-size: 0.62rem;
}

.timeline-tile-warning {
    border-color: rgba(216, 161, 60, 0.42);
    background:
        radial-gradient(circle at top right, rgba(216, 161, 60, 0.2), transparent 35%),
        linear-gradient(180deg, #fffaf0 0%, #fff4d7 100%);
}

.timeline-tile-danger {
    border-color: rgba(211, 84, 84, 0.46);
    background:
        radial-gradient(circle at top right, rgba(211, 84, 84, 0.2), transparent 35%),
        linear-gradient(180deg, #fff6f6 0%, #ffe5e5 100%);
}

.timeline-detail-modal .modal-header {
    align-items: flex-start;
}

.timeline-detail-dialog {
    max-width: min(1180px, calc(100vw - 32px));
}

#timelineDetailModal {
    position: fixed;
    inset: 0;
    z-index: 10050 !important;
    pointer-events: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

#timelineDetailModal .modal-dialog,
#timelineDetailModal .modal-content {
    pointer-events: auto;
}

.timeline-detail-safe-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: none;
    background: rgba(12, 23, 34, 0.55);
}

.timeline-detail-safe-backdrop.is-visible {
    display: block;
}

.timeline-detail-author {
    order: -1;
    margin-left: 0;
    margin-right: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--app-primary);
    font-size: 0.74rem;
    font-weight: 800;
}

@media (max-width: 991.98px) {
    .timeline-tile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .timeline-tile-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.timeline-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--app-muted);
    font-weight: 700;
}

.timeline-detail-fields {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.06);
    color: var(--app-text);
    font-weight: 700;
    line-height: 1.6;
}

.timeline-detail-care-note {
    min-height: 220px;
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(15, 118, 110, 0.045);
    border: 1px solid rgba(15, 118, 110, 0.1);
    color: var(--app-text);
    line-height: 1.6;
    white-space: pre-wrap;
}

.timeline-detail-overflow-note {
    color: var(--app-muted);
    font-style: italic;
}

.activity-feed .list-item {
    padding: 12px 14px;
    font-size: 0.74rem;
    line-height: 1.32;
}

.activity-feed .list-item strong {
    font-size: 0.78rem;
}

.activity-feed .muted-copy,
.activity-feed .app-chip,
.activity-feed .status-pill {
    font-size: 0.68rem;
}

.quick-pick-panel {
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(44, 105, 207, 0.12);
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.95), rgba(239, 246, 255, 0.98));
}

.quick-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.quick-pick-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(57, 90, 132, 0.14);
    background: #ffffff;
    color: #173554;
    font-weight: 700;
    text-align: left;
    box-shadow: 0 12px 20px rgba(23, 53, 84, 0.05);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.quick-pick-chip:hover,
.quick-pick-chip:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(44, 105, 207, 0.32);
    box-shadow: 0 18px 28px rgba(23, 53, 84, 0.08);
    outline: none;
}

.quick-pick-chip img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.quick-pick-chip i {
    color: var(--app-primary);
    font-size: 1.15rem;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.resident-corner-badge {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 164px;
    justify-content: center;
    padding: 6px 14px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    box-shadow: 0 16px 24px rgba(15, 23, 42, 0.18);
}

.resident-corner-badge-right {
    top: 14px;
    right: -44px;
    transform: rotate(34deg);
}

.resident-corner-badge-left {
    top: 14px;
    left: -48px;
    transform: rotate(-34deg);
}

.resident-corner-badge-birthday {
    background: linear-gradient(180deg, #6a57c7 0%, #5038aa 100%);
}

.resident-corner-badge-success {
    background: linear-gradient(180deg, #299c67 0%, #227d53 100%);
}

.resident-corner-badge-warning {
    background: linear-gradient(180deg, #d8a13c 0%, #b37c20 100%);
}

.resident-corner-badge-danger {
    background: linear-gradient(180deg, #d35454 0%, #af3535 100%);
}

.timeline-card {
    padding: 18px 20px;
}

.timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.timeline-title {
    font-weight: 800;
    margin: 0;
}

.timeline-subtitle {
    color: var(--app-muted);
    font-size: 0.88rem;
}

.timeline-time {
    color: var(--app-primary);
    font-weight: 700;
    white-space: nowrap;
}

.note-list {
    margin: 0;
    padding-left: 18px;
    color: var(--app-text);
}

.note-list li + li {
    margin-top: 6px;
}

.empty-state {
    padding: 32px;
    text-align: center;
    color: var(--app-muted);
}

.table-card .table {
    margin-bottom: 0;
}

.table-card .table thead th {
    border-top: none;
    color: var(--app-muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.table-card .table td,
.table-card .table th {
    vertical-align: middle;
    border-color: rgba(15, 118, 110, 0.08);
}

.table-card .table tbody tr:hover {
    background: rgba(15, 118, 110, 0.04);
}

.mar-profile-table {
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.mar-profile-table th,
.mar-profile-table td {
    padding: 6px;
    border: 0;
    background: transparent;
    vertical-align: top;
}

.mar-profile-table tbody tr:hover {
    background: transparent;
}

.mar-profile-table .mar-sticky-profile,
.mar-profile-table .mar-sticky-time {
    position: sticky;
    background: var(--app-surface);
}

.mar-profile-table .mar-sticky-profile {
    left: 0;
    z-index: 4;
}

.mar-profile-table .mar-sticky-time {
    left: 332px;
    z-index: 3;
}

.mar-profile-table .mar-sticky-profile,
.mar-profile-cell {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

.mar-profile-table .mar-sticky-time,
.mar-time-dose-cell {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}

.mar-profile-table thead .mar-sticky-profile,
.mar-profile-table thead .mar-sticky-time {
    z-index: 6;
}

.mar-profile-table .mar-sticky-profile::after,
.mar-profile-table .mar-sticky-time::after {
    content: '';
    position: absolute;
    inset: 6px -8px 6px auto;
    width: 12px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.16), rgba(15, 118, 110, 0));
}

.mar-column-head,
.mar-profile-card,
.mar-time-dose-card {
    border-radius: 18px;
    border: 1px solid rgba(102, 155, 205, 0.26);
    box-shadow: 0 12px 28px rgba(26, 84, 123, 0.08);
}

.mar-column-head {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 10px;
    text-align: center;
    background: linear-gradient(180deg, rgba(236, 245, 255, 0.98), rgba(221, 236, 252, 0.96));
    color: #1d5c8d;
}

.mar-column-head small {
    color: rgba(29, 92, 141, 0.82);
    font-size: 0.74rem;
    text-transform: none;
    letter-spacing: 0.01em;
}

.mar-column-head-profile,
.mar-column-head-time {
    align-items: flex-start;
    text-align: left;
}

.mar-column-head-day {
    min-width: 78px;
}

.table-sticky-first th:first-child,
.table-sticky-first td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--app-surface-strong);
}

.table-sticky-first thead th:first-child {
    z-index: 3;
}

.table-sticky-left-2 th:nth-child(1),
.table-sticky-left-2 td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--app-surface-strong);
}

.table-sticky-left-2 th:nth-child(2),
.table-sticky-left-2 td:nth-child(2) {
    position: sticky;
    left: 320px;
    z-index: 2;
    background: var(--app-surface-strong);
}

.table-sticky-left-2 thead th:nth-child(1),
.table-sticky-left-2 thead th:nth-child(2) {
    z-index: 4;
}

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

.about-block {
    padding: 16px;
    border-radius: 20px;
    background: rgba(238, 245, 242, 0.85);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.about-block h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-primary);
}

.about-block p {
    margin: 0;
}

.resident-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
}

.resident-hero img {
    width: 112px;
    height: 112px;
    border-radius: 28px;
    object-fit: cover;
}

.mar-cell {
    min-height: 78px;
    text-align: center;
    border-radius: 18px;
    padding: 12px 8px;
    border: 1px solid rgba(123, 157, 188, 0.18);
    box-shadow: 0 10px 20px rgba(26, 84, 123, 0.08);
    font-size: 0.82rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.mar-cell.is-clickable {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mar-cell.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(17, 81, 76, 0.12);
}

.mar-cell.given {
    background: rgba(47, 133, 90, 0.1);
    border-color: rgba(47, 133, 90, 0.2);
    color: var(--app-success);
}

.mar-cell.refused,
.mar-cell.missed {
    background: rgba(185, 85, 85, 0.1);
    border-color: rgba(185, 85, 85, 0.2);
    color: var(--app-danger);
}

.mar-cell.withheld,
.mar-cell.due {
    background: rgba(208, 139, 45, 0.12);
    border-color: rgba(208, 139, 45, 0.22);
    color: var(--app-warning);
}

.mar-cell.awaiting-signoff {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #2563eb;
}

.mar-cell.pending {
    background: rgba(37, 99, 167, 0.08);
    border-color: rgba(37, 99, 167, 0.14);
    color: var(--app-primary);
}

.mar-cell.inactive {
    background: rgba(229, 239, 248, 0.58);
    color: var(--app-muted);
    border-style: dashed;
}

.mar-cell-code {
    font-size: 1.06rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.mar-cell-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.22;
}

.mar-cell-initials {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.mar-cell-note {
    font-size: 0.68rem;
    line-height: 1.2;
}

.medication-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.85fr);
    gap: 18px;
}

.medication-management-card {
    height: 100%;
}

.medication-management-card.is-stopped {
    background: rgba(255, 248, 248, 0.95);
    border-color: rgba(185, 85, 85, 0.14);
}

.medication-stop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.medication-result-button {
    width: 100%;
    text-align: left;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.medication-result-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(17, 81, 76, 0.1);
    border-color: rgba(15, 118, 110, 0.18);
}

.medication-custom-panel {
    padding: 18px;
    border-radius: 20px;
    border: 1px dashed rgba(15, 118, 110, 0.18);
    background: rgba(248, 251, 249, 0.94);
}

.medication-time-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.medication-time-builder .form-control {
    max-width: 220px;
}

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

.medication-empty-times {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px dashed rgba(15, 118, 110, 0.16);
    background: rgba(248, 251, 249, 0.92);
    color: var(--app-muted);
}

.medication-time-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(238, 245, 242, 0.88);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.medication-time-item-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.medication-time-item-copy span {
    color: var(--app-muted);
    font-size: 0.85rem;
}

.medication-schedule-builder {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 220px) auto;
    gap: 14px;
    align-items: end;
}

.medication-schedule-button-wrap {
    display: flex;
    align-items: flex-end;
}

.medication-schedule-button-wrap .btn {
    white-space: nowrap;
}

.mar-profile-table td,
.mar-profile-table th {
    vertical-align: top;
}

.mar-profile-cell {
    min-width: 320px;
}

.mar-profile-card {
    min-height: 100%;
    padding: 16px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(237, 245, 252, 0.96));
}

.mar-profile-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    color: #14496f;
}

.mar-profile-copy,
.mar-profile-instructions {
    margin-top: 6px;
    color: var(--app-muted);
    line-height: 1.45;
}

.mar-time-dose-cell {
    min-width: 130px;
}

.mar-time-dose-card {
    min-height: 100%;
    padding: 16px 14px;
    background: linear-gradient(180deg, rgba(241, 248, 255, 0.98), rgba(229, 241, 252, 0.96));
    text-align: left;
}

.mar-time-dose-card strong,
.mar-time-dose-card span {
    display: block;
}

.mar-time-dose-card strong {
    font-size: 0.98rem;
    color: #14496f;
}

.mar-time-dose-card span {
    margin-top: 4px;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.medication-stock-audit {
    display: grid;
    gap: 8px;
}

.medication-stock-audit-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 118, 110, 0.08);
    color: var(--app-muted);
    font-size: 0.84rem;
}

.medication-modal-note {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(238, 245, 242, 0.9);
    border: 1px solid rgba(15, 118, 110, 0.08);
    color: var(--app-muted);
    line-height: 1.45;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(340px, 480px) minmax(0, 1fr);
    gap: 28px;
    padding: 36px;
}

.auth-card {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    text-decoration: none;
    color: inherit;
}

.auth-brand img {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 20px;
}

.auth-card h1 {
    margin: 0 0 10px;
    font-family: 'Fraunces', serif;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 1.02;
}

.auth-card p {
    color: var(--app-muted);
}

.auth-form .form-control {
    height: auto;
    border-radius: 16px;
    border-color: var(--app-border);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.auth-pin-input {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.32em;
}

.auth-form .btn {
    border-radius: 999px;
    padding: 14px 18px;
    font-weight: 700;
}

.auth-footnote {
    margin-top: 18px;
    color: var(--app-muted);
    font-size: 0.92rem;
}

.auth-visual {
    padding: 34px;
    background:
        radial-gradient(circle at top right, rgba(231, 180, 107, 0.38), transparent 28%),
        linear-gradient(145deg, rgba(17, 81, 76, 0.92) 0%, rgba(14, 50, 47, 0.98) 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.auth-visual::after,
.auth-visual::before {
    content: '';
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-visual::before {
    width: 220px;
    height: 220px;
    right: -60px;
    top: -60px;
}

.auth-visual::after {
    width: 320px;
    height: 320px;
    left: -110px;
    bottom: -120px;
}

.auth-visual-copy {
    position: relative;
    z-index: 1;
}

.auth-feature-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.auth-feature {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-feature strong {
    display: block;
    margin-bottom: 4px;
}

.list-stack {
    display: grid;
    gap: 14px;
}

.list-item {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(238, 245, 242, 0.78);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.compact-overview-feed {
    gap: 10px;
    transition: max-height 0.2s ease;
}

.compact-overview-feed.is-collapsed {
    max-height: 248px;
    overflow: hidden;
}

.compact-overview-feed .list-item {
    padding: 10px 12px;
    border-radius: 16px;
}

.compact-overview-feed strong {
    font-size: 0.78rem;
    line-height: 1.28;
}

.compact-overview-feed .muted-copy,
.compact-overview-feed .resident-meta,
.compact-overview-feed .app-chip,
.compact-overview-feed .status-pill {
    font-size: 0.66rem;
}

.compact-overview-feed .chip-row {
    gap: 6px;
    margin-top: 8px !important;
}

.bar-list {
    display: grid;
    gap: 14px;
}

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

.admin-quick-links {
    display: grid;
    gap: 14px;
}

.admin-quick-link {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(37, 99, 167, 0.12);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(236, 245, 255, 0.96));
    color: var(--app-text);
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.admin-quick-link:hover {
    color: var(--app-text);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(27, 84, 124, 0.12);
    border-color: rgba(37, 99, 167, 0.24);
}

.admin-quick-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(37, 99, 167, 0.12);
    color: #1f5c8f;
    font-size: 1.1rem;
}

.admin-quick-link span:last-child {
    color: var(--app-muted);
    line-height: 1.5;
}

.document-preview-frame {
    width: 100%;
    min-height: 780px;
    border: 1px solid rgba(37, 99, 167, 0.14);
    border-radius: 22px;
    background: #ffffff;
}

.bar-row-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.92rem;
}

.bar-track {
    background: rgba(15, 118, 110, 0.08);
    border-radius: 999px;
    overflow: hidden;
    height: 12px;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--app-primary) 0%, var(--app-secondary) 100%);
}

.app-modal {
    border: none;
    border-radius: 24px;
}

.app-modal .form-control,
.app-modal .custom-select,
.app-modal textarea {
    min-height: 52px;
    border-width: 1.5px;
}

.app-modal textarea {
    min-height: 120px;
}

.resident-photo-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.resident-photo-button {
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.resident-hero--assessment {
    align-items: flex-start;
}

.assessment-progress-card {
    border-radius: 22px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(16, 94, 137, 0.08), rgba(15, 118, 110, 0.06));
    border: 1px solid rgba(16, 94, 137, 0.12);
}

.assessment-progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.assessment-progress-copy strong {
    font-size: 0.98rem;
}

.assessment-progress-copy span {
    color: var(--app-muted);
    font-size: 0.9rem;
}

.assessment-progress-bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.09);
    overflow: hidden;
}

.assessment-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f7a8c 0%, #0f766e 50%, #2f855a 100%);
}

.assessment-toolkit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.assessment-tool-card {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(243, 248, 247, 0.92));
    box-shadow: 0 18px 44px rgba(19, 57, 64, 0.08);
}

.assessment-tone-blue {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(237, 246, 255, 0.96));
}

.assessment-tone-emerald {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(236, 248, 241, 0.96));
}

.assessment-tone-amber {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(252, 247, 236, 0.96));
}

.assessment-tone-rose {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(252, 241, 242, 0.96));
}

.assessment-tone-violet {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 241, 252, 0.96));
}

.assessment-tool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.assessment-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(31, 122, 140, 0.14), rgba(15, 118, 110, 0.14));
    color: #155e75;
    font-size: 1.05rem;
}

.assessment-tool-card h3,
.assessment-section-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.assessment-meta-grid,
.assessment-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.assessment-meta-item,
.assessment-overview-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.assessment-meta-label,
.assessment-overview-label {
    display: block;
    margin-bottom: 6px;
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.assessment-score-line {
    margin-top: 14px;
}

.assessment-mini-stack {
    display: grid;
    gap: 10px;
}

.assessment-mini-item,
.assessment-guidance-item {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.assessment-mini-item strong,
.assessment-guidance-item strong {
    display: block;
    margin-bottom: 4px;
}

.assessment-mini-item span,
.assessment-guidance-item p {
    color: var(--app-muted);
}

.empty-inline-note {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(208, 139, 45, 0.1);
    color: #8b5d14;
    font-weight: 600;
}

.assessment-summary-layout {
    align-items: start;
}

.assessment-section-card {
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 249, 248, 0.94));
    border: 1px solid rgba(15, 118, 110, 0.1);
    box-shadow: 0 14px 36px rgba(15, 55, 66, 0.06);
}

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

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

.assessment-section-head p {
    margin: 8px 0 0;
    color: var(--app-muted);
}

.assessment-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.assessment-field {
    min-width: 0;
}

.assessment-field.is-full-width {
    grid-column: 1 / -1;
}

.assessment-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.assessment-field-hint {
    margin: -4px 0 8px;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.assessment-field .form-control,
.assessment-field .custom-select,
.assessment-field textarea {
    border-radius: 16px;
    border-color: rgba(15, 118, 110, 0.18);
    padding: 12px 14px;
    min-height: 48px;
}

.assessment-field textarea {
    min-height: 120px;
}

.assessment-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.assessment-choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.assessment-choice-card:hover {
    transform: translateY(-1px);
    border-color: rgba(21, 94, 117, 0.28);
    box-shadow: 0 10px 22px rgba(15, 55, 66, 0.08);
}

.assessment-choice-card input {
    margin-top: 3px;
}

.assessment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(21, 94, 117, 0.08), rgba(15, 118, 110, 0.08));
    border: 1px solid rgba(21, 94, 117, 0.12);
}

.assessment-form-footer-copy {
    display: grid;
    gap: 4px;
}

.assessment-form-footer-copy span {
    color: var(--app-muted);
}

.activity-tile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: stretch;
}

.activity-tile,
.activity-form-card {
    --tone-deep: var(--app-primary);
    --tone-soft: rgba(15, 118, 110, 0.12);
    --tone-glow: rgba(231, 180, 107, 0.18);
}

.activity-tone-care {
    --tone-deep: #2f8f5a;
    --tone-soft: rgba(47, 143, 90, 0.16);
    --tone-glow: rgba(173, 228, 193, 0.42);
}

.activity-tone-safety {
    --tone-deep: #58737f;
    --tone-soft: rgba(88, 115, 127, 0.16);
    --tone-glow: rgba(196, 214, 223, 0.44);
}

.activity-tone-nutrition {
    --tone-deep: #be7b1d;
    --tone-soft: rgba(190, 123, 29, 0.16);
    --tone-glow: rgba(244, 212, 158, 0.4);
}

.activity-tone-hydration {
    --tone-deep: #2b8ab6;
    --tone-soft: rgba(43, 138, 182, 0.16);
    --tone-glow: rgba(188, 229, 245, 0.42);
}

.activity-tone-wellbeing {
    --tone-deep: #cf6a47;
    --tone-soft: rgba(207, 106, 71, 0.16);
    --tone-glow: rgba(244, 197, 180, 0.4);
}

.activity-tone-communication {
    --tone-deep: #6d57ba;
    --tone-soft: rgba(109, 87, 186, 0.16);
    --tone-glow: rgba(207, 196, 245, 0.42);
}

.activity-tone-continence {
    --tone-deep: #8f5aa8;
    --tone-soft: rgba(143, 90, 168, 0.16);
    --tone-glow: rgba(223, 194, 236, 0.4);
}

.activity-tone-mobility {
    --tone-deep: #16806a;
    --tone-soft: rgba(22, 128, 106, 0.16);
    --tone-glow: rgba(182, 233, 220, 0.4);
}

.activity-tone-medical {
    --tone-deep: #2c69cf;
    --tone-soft: rgba(44, 105, 207, 0.16);
    --tone-glow: rgba(188, 214, 255, 0.42);
}

.activity-tone-emotional {
    --tone-deep: #c85c84;
    --tone-soft: rgba(200, 92, 132, 0.16);
    --tone-glow: rgba(245, 200, 218, 0.42);
}

.activity-tone-sleep {
    --tone-deep: #5166c7;
    --tone-soft: rgba(81, 102, 199, 0.16);
    --tone-glow: rgba(199, 208, 247, 0.42);
}

.activity-tone-admin {
    --tone-deep: #7a6348;
    --tone-soft: rgba(122, 99, 72, 0.16);
    --tone-glow: rgba(229, 213, 190, 0.42);
}

.activity-tone-neutral {
    --tone-deep: var(--app-primary);
    --tone-soft: rgba(15, 118, 110, 0.12);
    --tone-glow: rgba(231, 180, 107, 0.18);
}

.activity-tile {
    position: relative;
    flex: 0 0 188px;
    max-width: 188px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 94px;
    gap: 10px;
    padding: 16px 40px 16px 16px;
    border: 1px solid var(--tone-soft);
    border-left: 6px solid var(--tone-deep);
    border-radius: 20px;
    background:
        linear-gradient(135deg, var(--tone-soft) 0%, rgba(255, 255, 255, 0.96) 100%);
    box-shadow: 0 10px 20px rgba(18, 49, 43, 0.07);
    color: var(--tone-deep);
    font: inherit;
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.activity-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 70%);
    pointer-events: none;
}

.activity-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(18, 49, 43, 0.12);
    border-color: var(--tone-deep);
}

.activity-tile.is-selected {
    transform: translateY(-2px);
    border-color: var(--tone-deep);
    background: linear-gradient(135deg, var(--tone-deep) 0%, rgba(24, 49, 43, 0.92) 130%);
    box-shadow: 0 18px 30px rgba(18, 49, 43, 0.16);
}

.activity-tile.is-selected .activity-tile-title {
    color: #ffffff;
}

.activity-tile-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    opacity: 0;
    transform: scale(0.82);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.activity-tile.is-selected .activity-tile-check {
    opacity: 1;
    transform: scale(1);
}

.activity-tile-title {
    position: relative;
    z-index: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 800;
    width: 100%;
}

.activity-tile-art {
    position: relative;
    z-index: 1;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74), 0 10px 22px rgba(18, 49, 43, 0.12);
}

.activity-tile-art img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.activity-tile-art i {
    color: var(--tone-deep);
    font-size: 1.45rem;
}

.activity-tile-icon {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--tone-deep);
    font-size: 1.28rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68), 0 10px 24px rgba(18, 49, 43, 0.12);
}

.activity-tile-icon--image {
    background: rgba(255, 255, 255, 0.9);
}

.activity-tile-icon--image img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.activity-tile-icon--image i {
    color: var(--tone-deep);
    font-size: 1.35rem;
}

.chip-icon-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.activity-form-card {
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    background:
        radial-gradient(circle at top right, var(--tone-glow), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 248, 247, 0.98) 100%);
    box-shadow: var(--app-shadow);
}

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

.activity-form-identity {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.activity-form-identity h3 {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 800;
}

.activity-form-identity p {
    margin: 4px 0 0;
    color: var(--app-muted);
}

.activity-hint-callout,
.activity-error-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.activity-hint-callout {
    background: rgba(255, 255, 255, 0.76);
    color: var(--tone-deep);
    border: 1px solid rgba(255, 255, 255, 0.62);
}

.activity-error-callout {
    background: rgba(185, 85, 85, 0.1);
    color: var(--app-danger);
    border: 1px solid rgba(185, 85, 85, 0.16);
}

.activity-fields-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
}

.activity-field {
    margin-bottom: 0;
    grid-column: span 12;
}

.activity-field.span-4 {
    grid-column: span 4;
}

.activity-field.span-6 {
    grid-column: span 6;
}

.activity-field.span-8 {
    grid-column: span 8;
}

.activity-field.span-12 {
    grid-column: span 12;
}

.activity-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.activity-field .form-control,
.activity-field .custom-select {
    height: auto;
    border-radius: 16px;
    border-color: var(--app-border);
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.activity-field .form-control:focus,
.activity-field .custom-select:focus {
    border-color: var(--tone-deep);
    box-shadow: 0 0 0 0.2rem var(--tone-soft);
}

.activity-field textarea.form-control {
    min-height: 136px;
    resize: vertical;
}

.activity-input-shell {
    position: relative;
}

.activity-input-shell .form-control {
    padding-right: 72px;
}

.activity-input-suffix {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.activity-field-hint {
    display: block;
    margin-top: 8px;
    color: var(--app-muted);
    line-height: 1.45;
}

.activity-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.activity-choice {
    margin: 0;
    position: relative;
    cursor: pointer;
}

.activity-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.activity-choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 118, 110, 0.1);
    background: rgba(255, 255, 255, 0.84);
    color: var(--app-text);
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.activity-choice input:checked + span {
    background: var(--tone-deep);
    border-color: var(--tone-deep);
    color: #ffffff;
    box-shadow: 0 14px 26px rgba(18, 49, 43, 0.14);
}

.activity-choice input:focus + span {
    outline: 2px solid rgba(15, 118, 110, 0.18);
    outline-offset: 2px;
}

.activity-loading-copy {
    padding-left: 70px;
    color: var(--app-muted);
}

.activity-category-heading h3 {
    color: var(--tone-deep);
}

.activity-category-heading p {
    color: rgba(24, 49, 43, 0.68);
}

.hidden-by-filter {
    display: none !important;
}

.app-success-modal {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(231, 180, 107, 0.28), transparent 30%),
        radial-gradient(circle at bottom right, rgba(44, 105, 207, 0.18), transparent 28%),
        linear-gradient(180deg, #fbfdff 0%, #f4f8fd 100%);
}

.app-success-modal-hero {
    padding: 34px 30px 18px;
    text-align: center;
    display: grid;
    gap: 12px;
}

.app-success-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    color: #ffffff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #2f8f5a 0%, #5da97c 100%);
    box-shadow: 0 18px 32px rgba(47, 143, 90, 0.24);
}

.app-success-eyebrow {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4a76a1;
}

.app-success-modal .modal-title {
    font-family: 'Fraunces', serif;
    font-size: 1.9rem;
    color: #173b62;
}

.app-success-modal p {
    color: #58708c;
    font-size: 1rem;
}

.company-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.company-group-header {
    align-items: center;
}

.company-group-body.is-collapsed {
    display: none;
}

.company-group-toggle {
    min-width: 126px;
    justify-content: center;
}

.company-group-toggle i {
    transition: transform 0.18s ease;
}

.company-group-toggle.is-collapsed {
    background: rgba(24, 49, 43, 0.06);
}

.company-group-toggle.is-collapsed i {
    transform: rotate(-90deg);
}

.compact-summary-card {
    padding: 18px;
}

.compact-list .list-item {
    padding: 14px 16px;
}

.report-chart-shell {
    position: relative;
    min-height: 290px;
}

.report-chart-shell canvas {
    width: 100% !important;
    height: 290px !important;
}

.hydration-banner {
    display: grid;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(44, 105, 207, 0.12);
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(241, 247, 253, 0.96));
}

.hydration-banner-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.hydration-banner-head strong {
    display: block;
    margin-bottom: 4px;
    color: #1a4c77;
}

.hydration-banner-head span,
.hydration-banner-head small {
    color: var(--app-muted);
}

.hydration-banner-totals {
    display: grid;
    justify-items: end;
    gap: 2px;
    font-weight: 700;
    color: #1a4c77;
}

.hydration-progress-shell {
    display: grid;
    gap: 8px;
}

.hydration-progress-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(24, 49, 43, 0.08);
}

.hydration-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #cf5e5e 0%, #dca642 58%, #2f8f5a 100%);
}

.hydration-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--app-muted);
    font-size: 0.84rem;
}

.hydration-banner-danger {
    border-color: rgba(185, 85, 85, 0.22);
}

.hydration-banner-warning {
    border-color: rgba(208, 139, 45, 0.22);
}

.hydration-banner-success {
    border-color: rgba(47, 133, 90, 0.22);
}

.fluid-chip-danger {
    background: rgba(185, 85, 85, 0.12);
    color: var(--app-danger);
}

.fluid-chip-warning {
    background: rgba(208, 139, 45, 0.14);
    color: var(--app-warning);
}

.fluid-chip-success {
    background: rgba(47, 133, 90, 0.12);
    color: var(--app-success);
}

.fluid-chip-info {
    background: rgba(43, 138, 182, 0.12);
    color: #2b8ab6;
}

.fluid-widget-shell {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(238, 246, 251, 0.96));
    border: 1px solid rgba(43, 138, 182, 0.16);
}

.fluid-tumbler {
    position: relative;
    width: 84px;
    height: 132px;
    margin: 0 auto;
    border: 3px solid rgba(43, 138, 182, 0.52);
    border-top: 10px solid rgba(43, 138, 182, 0.42);
    border-radius: 24px 24px 20px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(230, 241, 249, 0.92));
    overflow: hidden;
    cursor: ns-resize;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 14px 26px rgba(18, 49, 43, 0.1);
}

.fluid-tumbler-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, rgba(103, 196, 231, 0.95), rgba(43, 138, 182, 0.94));
    transition: height 0.16s ease;
}

.fluid-tumbler-scale {
    position: absolute;
    inset: 14px 10px 14px auto;
    width: 10px;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.82) 8%, transparent 8%);
    background-size: 100% 16px;
    opacity: 0.72;
    pointer-events: none;
}

.fluid-widget-details {
    display: grid;
    gap: 10px;
}

.fluid-widget-value {
    font-size: 1rem;
    font-weight: 800;
    color: #1d5b88;
}

.fluid-widget-helper {
    font-size: 0.84rem;
    color: var(--app-muted);
}

.fluid-widget-input {
    max-width: 180px;
}

@media (max-width: 767px) {
    .activity-tile-grid,
    .activity-choice-grid {
        grid-template-columns: 1fr;
    }

    .activity-tile {
        flex: 1 1 100%;
        max-width: none;
    }

    .fluid-widget-shell {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .fluid-widget-input {
        max-width: none;
    }

    .activity-form-card-head {
        flex-direction: column;
    }

    .activity-fields-grid {
        grid-template-columns: 1fr;
    }

    .activity-field,
    .activity-field.span-4,
    .activity-field.span-6,
    .activity-field.span-8,
    .activity-field.span-12 {
        grid-column: span 1;
    }

    .activity-loading-copy {
        padding-left: 0;
    }

    .medication-management-grid {
        grid-template-columns: 1fr;
    }

    .medication-time-builder .form-control {
        max-width: none;
    }

    .medication-time-item {
        flex-direction: column;
        align-items: stretch;
    }

    .medication-schedule-builder {
        grid-template-columns: 1fr;
    }

    .medication-schedule-button-wrap {
        justify-content: stretch;
    }

    .detail-grid.detail-grid-two {
        grid-template-columns: 1fr;
    }

    .table-sticky-left-2 th:nth-child(1),
    .table-sticky-left-2 td:nth-child(1),
    .table-sticky-left-2 th:nth-child(2),
    .table-sticky-left-2 td:nth-child(2),
    .mar-profile-table .mar-sticky-profile,
    .mar-profile-table .mar-sticky-time {
        position: static;
    }

    .mar-profile-table .mar-sticky-profile::after,
.mar-profile-table .mar-sticky-time::after {
    display: none;
}
}

.provider-lookup-shell {
    border: 1px solid rgba(117, 148, 181, 0.24);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(242, 247, 253, 0.98) 100%);
}

.provider-search-state {
    font-size: 0.84rem;
    color: #5c7896;
    margin-bottom: 10px;
}

.provider-search-results {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

.provider-search-result {
    width: 100%;
    text-align: left;
    border: 1px solid rgba(79, 116, 161, 0.18);
    border-radius: 16px;
    background: #ffffff;
    padding: 12px 14px;
    color: #173554;
    display: grid;
    gap: 3px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.provider-search-result:hover {
    transform: translateY(-1px);
    border-color: rgba(31, 95, 155, 0.38);
    box-shadow: 0 14px 28px rgba(23, 53, 84, 0.08);
}

.provider-search-result strong {
    font-size: 0.96rem;
}

.provider-search-result span,
.provider-selection-preview span {
    display: block;
    font-size: 0.84rem;
    color: #5d7996;
}

.provider-selection-preview {
    border: 1px dashed rgba(79, 116, 161, 0.28);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.8);
}

.important-contact-editor {
    display: grid;
    gap: 14px;
}

.important-contact-card {
    border: 1px solid rgba(117, 148, 181, 0.18);
    border-radius: 20px;
    background: #ffffff;
    padding: 16px;
}

.incident-recognition {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 2px;
}

.incident-recognition i {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5f1ff 0%, #f6fbff 100%);
    color: #1f5f9b;
    font-size: 1.2rem;
}

.notes-print-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.notes-print-meta div {
    border: 1px solid rgba(117, 148, 181, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.98) 0%, rgba(239, 246, 255, 0.98) 100%);
    padding: 14px;
}

.notes-print-meta strong {
    display: block;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5b7794;
    margin-bottom: 5px;
}

.notes-print-list {
    display: grid;
    gap: 14px;
}

.notes-print-card {
    border: 1px solid rgba(117, 148, 181, 0.18);
    border-radius: 20px;
    background: #ffffff;
    padding: 18px;
}

.notes-print-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.notes-print-card-head span,
.notes-print-author {
    color: #607b97;
    font-size: 0.86rem;
}

.auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--app-primary);
}

.legal-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.legal-card {
    width: min(940px, 100%);
    border-radius: 30px;
    padding: 34px;
    background:
        radial-gradient(circle at top right, rgba(231, 180, 107, 0.18), transparent 28%),
        rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 118, 110, 0.13);
    box-shadow: var(--app-shadow);
}

.legal-card h1 {
    margin: 18px 0 6px;
    font-family: 'Fraunces', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
}

.legal-updated {
    color: var(--app-muted);
    font-weight: 700;
}

.legal-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 118, 110, 0.12);
}

.legal-section h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--app-primary-deep);
    font-weight: 800;
}

.legal-section p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.7;
}

.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.cookie-banner {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2000;
    width: min(620px, calc(100vw - 44px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 118, 110, 0.16);
    box-shadow: 0 28px 70px rgba(18, 49, 43, 0.2);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner-copy {
    display: grid;
    gap: 5px;
    color: var(--app-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.cookie-banner-copy strong {
    color: var(--app-text);
}

.cookie-banner-links {
    display: flex;
    gap: 12px;
    font-weight: 800;
    color: var(--app-primary);
}

.cookie-banner-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

@media (max-width: 1199px) {
    .app-grid.two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .app-shell {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        z-index: 1040;
    }

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

    .app-main {
        padding: 18px;
    }

    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-topbar-toggle {
        display: inline-flex;
        align-self: flex-start;
    }

    .app-page-hero {
        padding: 24px 22px;
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .notes-print-meta {
        grid-template-columns: 1fr 1fr;
    }

    .cookie-banner {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 575px) {
    .app-main {
        padding: 14px;
    }

    .resident-grid,
    .medication-alert-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .metric-card,
    .summary-card,
    .panel-card,
    .table-card,
    .resident-card,
    .timeline-card,
    .auth-card,
    .auth-visual {
        padding: 18px;
        border-radius: 20px;
    }

    .resident-card,
    .medication-alert-card {
        padding: 12px;
        border-radius: 18px;
    }

    .resident-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .resident-avatar {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    .resident-card h3,
    .resident-card h4,
    .medication-alert-card h3 {
        font-size: 0.9rem;
        line-height: 1.2;
    }

    .resident-meta,
    .card-copy,
    .medication-alert-copy {
        font-size: 0.72rem;
    }

    .resident-actions {
        gap: 6px;
    }

    .resident-actions .btn {
        width: 100%;
        padding: 0.38rem 0.45rem;
        font-size: 0.72rem;
    }

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

    .resident-hero img {
        width: 84px;
        height: 84px;
    }

    .assessment-field-grid {
        grid-template-columns: 1fr;
    }

    .assessment-form-footer,
    .assessment-progress-copy {
        flex-direction: column;
        align-items: flex-start;
    }

    .legal-card {
        padding: 24px;
        border-radius: 24px;
    }
}

@media print {
    .app-sidebar,
    .app-topbar,
    .app-page-actions,
    .filter-bar,
    .resident-actions,
    .card-actions,
    .stack-actions,
    .btn,
    .modal,
    .app-alert {
        display: none !important;
    }

    body.app-body {
        background: #ffffff;
    }

    .app-main,
    .app-content {
        padding: 0;
        max-width: none;
    }

    .panel-card,
    .metric-card,
    .resident-card,
    .timeline-card,
    .summary-card,
    .table-card {
        box-shadow: none;
        border: 1px solid #d7d7d7;
        break-inside: avoid;
    }
}
