:root {
    --vechio-primary: #C54A00;
    --vechio-dark-orange: #8A3000;
    --vechio-accent-gold: #FFC66A;
    --vechio-light-gold: #FFE1AB;
    --vechio-warm-cream: #FFF7EB;
    --vechio-neutral: #F3E5DB;
    --vechio-surface: #FFFDF9;
    --vechio-text-dark: #2D1F0F;
    --vechio-text-secondary: #5F3C1B;
    --vechio-status-on-track: #2E7D32;
    --vechio-status-due-soon: #B7791F;
    --vechio-status-overdue: #C62828;
    --vechio-status-message: #2F6DB4;
    --vechio-shadow-soft: 0 12px 30px rgba(45, 31, 15, 0.1);
    --vechio-shadow-subtle: 0 6px 18px rgba(45, 31, 15, 0.08);
    --vechio-radius-lg: 1rem;
    --vechio-radius-xl: 1.25rem;
    --vechio-content-max-width: 1200px;
}

html,
body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--vechio-warm-cream);
    color: var(--vechio-text-dark);
}

a,
.btn-link {
    color: var(--vechio-dark-orange);
}

a:hover,
a:focus-visible,
.btn-link:hover,
.btn-link:focus-visible {
    color: var(--vechio-primary);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--vechio-status-on-track);
}

.invalid {
    outline: 1px solid var(--vechio-status-overdue);
}

.validation-message {
    color: var(--vechio-status-overdue);
}

.vechio-page-shell {
    width: min(var(--vechio-content-max-width), calc(100% - 2rem));
    margin-inline: auto;
    padding-block: 1.25rem 2rem;
}

.vechio-page-title {
    margin-bottom: 0.25rem;
    color: var(--vechio-dark-orange);
}

.vechio-page-subtitle {
    margin-bottom: 1rem;
    color: var(--vechio-text-secondary);
}

.vechio-surface-card {
    background-color: var(--vechio-surface);
    border: 1px solid #f3dfcc;
    border-radius: var(--vechio-radius-lg);
    box-shadow: var(--vechio-shadow-subtle);
}

.vechio-status-chip-on-track {
    background-color: #E4F3E6;
    color: var(--vechio-status-on-track);
}

.vechio-status-chip-due-soon {
    background-color: #FFF2D8;
    color: var(--vechio-status-due-soon);
}

.vechio-status-chip-overdue {
    background-color: #FCE4E4;
    color: var(--vechio-status-overdue);
}

.vechio-status-chip-message {
    background-color: #E8F1FD;
    color: var(--vechio-status-message);
}

.vechio-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255, 247, 235, 0.92) 0%, rgba(255, 247, 235, 1) 100%);
}

.vechio-auth-hero {
    position: relative;
    padding: 3rem 1rem 7rem;
    background-image: linear-gradient(160deg, rgba(45, 31, 15, 0.52), rgba(138, 48, 0, 0.42)), url('/_content/Vechio.Shared/images/morninghorizon_mountains.png');
    background-size: cover;
    background-position: center;
    color: #FFF7EB;
}

.vechio-auth-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 120px;
    background: linear-gradient(180deg, rgba(255, 247, 235, 0) 0%, rgba(255, 247, 235, 1) 84%);
}

.vechio-auth-brand {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin-inline: auto;
}

.vechio-auth-logo {
    width: min(230px, 70vw);
    margin-bottom: 1rem;
}

.vechio-auth-card-wrap {
    width: min(460px, calc(100% - 2rem));
    margin: -4.2rem auto 0;
    position: relative;
    z-index: 2;
}

.vechio-auth-card {
    border-radius: var(--vechio-radius-xl);
    background-color: var(--vechio-surface);
    box-shadow: var(--vechio-shadow-soft);
    border: 1px solid #f0dbc5;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjx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A1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.scanner-container {
    max-width: 420px;
}

.scanner-preview {
    width: 100%;
    min-height: 220px;
    border: 1px solid #d3d3d3;
    border-radius: 0.5rem;
    background-color: #111;
    object-fit: cover;
}

.notification-settings-select {
    min-width: 260px;
}

.notification-highlight {
    border: 2px solid var(--vechio-status-message);
    box-shadow: 0 0 0 2px rgba(47, 109, 180, 0.15);
}

.vechio-dashboard-shell {
    --vechio-dashboard-overlap: 6.25rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    min-width: 0;
}

.vechio-dashboard-content {
    width: min(var(--vechio-content-max-width), calc(100% - 2rem));
    margin-inline: auto;
    position: relative;
}

.vechio-dashboard-stats {
    position: relative;
    z-index: 1;
    margin-top: calc(-1 * var(--vechio-dashboard-overlap));
    margin-bottom: 1.75rem;
}

.vechio-dashboard-care-circle {
    position: relative;
    z-index: 1;
}

.vechio-dashboard-hero {
    min-height: clamp(12rem, 18vw, 15rem);
    display: flex;
    align-items: center;
    background-color: var(--vechio-dark-orange);
    background-size: cover;
    background-position: center 80%;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.vechio-dashboard-hero::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: clamp(5rem, 11vw, 9rem);
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(255, 247, 235, 0) 0%,
        rgba(255, 238, 214, 0.18) 28%,
        rgba(255, 240, 220, 0.5) 55%,
        rgba(255, 245, 232, 0.82) 80%,
        #FFF7EB 100%
    );
}

.vechio-dashboard-stat {
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 238, 216, 0.94)) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(90, 40, 5, 0.18) !important;
}

.vechio-dashboard-stat .vechio-stat-icon {
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    color: #E8620C;
    flex-shrink: 0;
}

.vechio-dashboard-stat .mud-typography-h4 {
    font-weight: 700;
    line-height: 1.1;
}

.vechio-dashboard-hero-content::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: min(36rem, 100%);
    background: linear-gradient(90deg, rgba(20, 14, 9, 0.58), rgba(20, 14, 9, 0.34) 70%, transparent);
    z-index: -1;
    pointer-events: none;
}

.vechio-dashboard-hero-content {
    position: relative;
    z-index: 0;
    width: min(var(--vechio-content-max-width), 100%);
    margin-inline: auto;
    padding: 1.75rem 2rem calc(0.75rem + var(--vechio-dashboard-overlap)) 4.75rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
    overflow-wrap: anywhere;
}

.vechio-dashboard-hero-title {
    max-width: 28rem;
    font-weight: 600;
}

.vechio-dashboard-hero-subtitle,
.vechio-dashboard-hero-time {
    color: #fff;
    max-width: 28rem;
}

.vechio-dashboard-hero-time {
    display: block;
    min-height: 1.25rem;
}

.mud-main-content.vechio-main-no-appbar {
    padding-top: 0;
}

.vechio-main-content:not(:has(.vechio-dashboard-shell)):not(:has(.profile-shell)) {
    padding-top: var(--vechio-status-bar-height, 0px);
}

.profile-shell {
    min-width: 0;
}

.profile-content {
    position: relative;
    z-index: 1;
    width: min(var(--vechio-content-max-width), calc(100% - 2rem));
    margin: calc(-1 * var(--vechio-dashboard-overlap)) auto 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.profile-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.profile-column > .profile-card:last-child {
    flex: 1 1 auto;
}

.profile-card {
    padding: 1.25rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 241, 222, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 22px rgba(90, 40, 5, 0.14);
    color: #2D1F0F;
}

.profile-loading {
    display: flex;
    justify-content: center;
}

.profile-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.profile-card-title .mud-icon-root {
    color: #E8620C;
    margin-right: 0.4rem;
}

.profile-card-title > span {
    display: inline-flex;
    align-items: center;
}

.profile-card-title > .mud-icon-root + span {
    margin-right: auto;
}

.profile-link {
    text-transform: none;
    font-weight: 600;
}

.profile-identity {
    text-align: center;
}

.profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.profile-avatar.mud-avatar {
    background: linear-gradient(135deg, #ED700F, #BA450A);
    color: #fff;
    border: 4px solid #fff;
    box-shadow: 0 6px 16px rgba(90, 40, 5, 0.25);
}

.profile-avatar-edit.mud-icon-button {
    position: absolute;
    right: 0.25rem;
    bottom: 0.25rem;
    background: #E8620C;
    color: #fff;
    padding: 0.4rem;
}

.profile-name {
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.profile-chip {
    display: inline-block;
    padding: 0.15rem 0.85rem;
    border-radius: 999px;
    background: #FFE3C2;
    color: #8A3000;
    font-weight: 600;
    font-size: 0.85rem;
}

.profile-facts,
.profile-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-facts {
    margin-top: 1rem;
    text-align: left;
}

.profile-facts li,
.profile-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
}

.profile-list li + li {
    border-top: 1px solid rgba(138, 48, 0, 0.12);
}

.profile-facts .mud-icon-root,
.profile-list > li > .mud-icon-root:first-child,
.profile-pref .mud-icon-root:first-child {
    color: #E8620C;
}

.profile-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-row-title {
    font-weight: 600;
}

.profile-row-sub {
    font-size: 0.8rem;
    opacity: 0.75;
}

.profile-role-on {
    color: #2E7D32 !important;
}

.profile-role-off {
    color: #9A8A7A !important;
}

.profile-details {
    display: grid;
    grid-template-columns: max-content 1fr;
    margin: 0;
}

.profile-details dt,
.profile-details dd {
    margin: 0;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(138, 48, 0, 0.12);
    overflow-wrap: anywhere;
}

.profile-details dt {
    font-weight: 700;
    padding-right: 1.5rem;
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #2E7D32;
}

.profile-circle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-circle-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 3.75rem;
    text-align: center;
}

.profile-pill {
    padding: 0.1rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-pref {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.profile-select {
    flex: 0 1 60%;
}

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

@media (max-width: 767.98px) {
    .profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.vechio-floating-bar {
    position: fixed;
    top: calc(0.5rem + var(--vechio-status-bar-height, env(safe-area-inset-top, 0px)));
    left: 0.5rem;
    right: 0.5rem;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.vechio-floating-bar-offset {
    left: calc(var(--mud-drawer-width-left, 240px) + 0.5rem);
}

.vechio-floating-bar > *,
.vechio-floating-actions > * {
    pointer-events: auto;
}

.vechio-floating-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vechio-floating-button,
.vechio-floating-button .mud-icon-button {
    color: #fff !important;
}

.vechio-floating-button .mud-icon-button,
.vechio-floating-button.mud-icon-button {
    background: rgba(45, 31, 15, 0.45);
    backdrop-filter: blur(4px);
}

.vechio-floating-button .mud-icon-root,
.vechio-floating-button.mud-icon-button .mud-icon-root {
    color: #fff !important;
    fill: #fff;
}

.vechio-floating-actions .mud-icon-root {
    font-size: 3rem;
    width: 2rem;
    height: 2rem;
}

.vechio-care-person {
    min-width: 116px;
    text-align: center;
}

@media (max-width: 768px) {
    .vechio-auth-hero {
        padding-top: 2rem;
        padding-bottom: 5.8rem;
    }

    .vechio-auth-card-wrap {
        width: calc(100% - 1.25rem);
        margin-top: -3.6rem;
    }

    body:has(.vechio-dashboard-shell) .mud-main-content {
        padding-top: 0;
    }

    body:has(.vechio-dashboard-shell) .mud-appbar.vechio-appbar {
        background: rgba(45, 31, 15, 0.28);
        border-bottom: 0;
        box-shadow: none;
    }

    html.vechio-mobile .vechio-mobile-viewport:has(.vechio-dashboard-shell) {
        padding-top: 0;
    }

    .vechio-dashboard-content {
        width: calc(100% - 1.25rem);
    }

    .vechio-dashboard-hero {
        min-height: clamp(13rem, 30svh, 16rem);
        padding-top: calc(var(--mud-appbar-height, 64px) + var(--vechio-status-bar-height, env(safe-area-inset-top, 0px)));
        background-position: 62% center;
    }

    .vechio-dashboard-hero-content {
        padding: 1.25rem 1.25rem calc(2rem + var(--vechio-dashboard-overlap));
    }

    .vechio-dashboard-hero-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .vechio-dashboard-shell .vechio-care-person {
        min-width: 0;
        flex: 1 1 4.5rem;
        overflow-wrap: anywhere;
    }

    .vechio-dashboard-stat > .mud-stack {
        flex-wrap: wrap;
    }

    .vechio-dashboard-stat .mud-stack {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}
