:root {
    color-scheme: light;
    --rose-50: #fff7f8;
    --rose-100: #fdecef;
    --rose-200: #f6d3da;
    --rose-500: #b73d61;
    --rose-600: #9f2f55;
    --rose-700: #842646;
    --burgundy-900: #32151f;
    --ink: #261d22;
    --muted: #665860;
    --line: #eadde2;
    --panel: rgba(255, 255, 255, 0.94);
    --shadow: 0 16px 42px rgba(73, 28, 47, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 221, 229, 0.78), transparent 32rem),
        linear-gradient(145deg, #fff9fa 0%, #f8eef2 46%, #fff 100%);
    color: var(--ink);
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
}

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

.app-corner-brand {
    align-items: center;
    display: inline-flex;
    height: 48px;
    left: 1rem;
    position: fixed;
    top: 0.75rem;
    width: 140px;
    z-index: 1030;
}

.app-corner-brand img {
    display: block;
    height: 44px;
    object-fit: contain;
    width: 132px;
}

.app-page-loader {
    align-items: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.98), rgba(255, 241, 245, 0.86)),
        var(--rose-50);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 1;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.42s ease, visibility 0.42s ease;
    visibility: visible;
    z-index: 3000;
}

.app-page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.app-loader-card {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transform: translateY(0);
}

.app-loader-card img {
    animation: logoPop var(--loader-duration, 900ms) ease both;
    display: block;
    height: 86px;
    object-fit: contain;
    width: 264px;
}

.app-loader-card span {
    color: var(--rose-700);
    font-weight: 800;
}

@keyframes logoPop {
    0% {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    58% {
        opacity: 1;
        transform: scale(1.03) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

a {
    color: var(--rose-700);
}

a:hover {
    color: var(--burgundy-900);
}

.text-secondary,
.text-muted {
    color: var(--muted) !important;
}

.badge.text-bg-light {
    background: #fff9fa !important;
    color: #5b2638 !important;
    border-color: var(--line) !important;
}

.alert {
    border-radius: 8px;
}

.btn {
    border-radius: 8px;
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--rose-600);
    --bs-btn-border-color: var(--rose-600);
    --bs-btn-hover-bg: var(--rose-700);
    --bs-btn-hover-border-color: var(--rose-700);
    --bs-btn-active-bg: #6f1d39;
    --bs-btn-active-border-color: #6f1d39;
    --bs-btn-focus-shadow-rgb: 159, 47, 85;
    box-shadow: 0 10px 20px rgba(159, 47, 85, 0.17);
}

.btn-outline-secondary,
.btn-outline-primary {
    --bs-btn-color: #5b2638;
    --bs-btn-border-color: #d8b6c2;
    --bs-btn-hover-bg: #fff0f3;
    --bs-btn-hover-border-color: var(--rose-500);
    --bs-btn-hover-color: #421725;
    --bs-btn-active-bg: #f8d9e1;
    --bs-btn-active-border-color: var(--rose-500);
    --bs-btn-active-color: #421725;
}

.form-control,
.form-select {
    border-color: #dbc3cb;
    border-radius: 8px;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--rose-500);
    box-shadow: 0 0 0 0.2rem rgba(183, 61, 97, 0.18);
}

.form-check-input:checked {
    background-color: var(--rose-600);
    border-color: var(--rose-600);
}

.page-link {
    color: var(--rose-700);
    border-color: var(--line);
}

.active > .page-link,
.page-link.active {
    background-color: var(--rose-600);
    border-color: var(--rose-600);
}

.table {
    --bs-table-color: var(--ink);
    --bs-table-border-color: #f0e3e8;
}

.home-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}

.home-eyebrow {
    color: var(--rose-700);
    font-weight: 750;
}

.home-title {
    color: var(--burgundy-900);
    max-width: 11ch;
}

.site-logo-frame {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    display: inline-flex;
    height: 76px;
    justify-content: center;
    padding: 0.35rem 0.55rem;
    width: min(240px, 72vw);
}

.site-logo {
    display: block;
    height: 100%;
    max-height: 64px;
    max-width: 100%;
    object-fit: contain;
    width: 100%;
}

.home-copy {
    max-width: 42rem;
}

.home-actions {
    align-items: center;
}

.home-visual {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 244, 247, 0.94)),
        radial-gradient(circle at 24% 20%, rgba(183, 61, 97, 0.17), transparent 12rem);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-height: 360px;
    overflow: hidden;
    padding: 1.25rem;
    position: relative;
}

.home-visual::before {
    background:
        linear-gradient(145deg, rgba(132, 38, 70, 0.09), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(0deg, transparent 0 40px, rgba(159, 47, 85, 0.06) 40px 41px),
        repeating-linear-gradient(90deg, transparent 0 40px, rgba(159, 47, 85, 0.06) 40px 41px);
    content: "";
    inset: 0;
    position: absolute;
}

.silhouette-group {
    align-items: end;
    display: flex;
    gap: 1rem;
    height: 210px;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.silhouette {
    background: linear-gradient(180deg, #6f2a43, #31151f);
    border-radius: 48% 48% 8px 8px;
    height: 142px;
    position: relative;
    width: 96px;
}

.silhouette::before {
    background: linear-gradient(180deg, #84405a, #4b1d30);
    border-radius: 50%;
    content: "";
    height: 58px;
    left: 50%;
    position: absolute;
    top: -46px;
    transform: translateX(-50%);
    width: 58px;
}

.silhouette.secondary {
    background: linear-gradient(180deg, #a44966, #462033);
    height: 128px;
    width: 88px;
}

.home-note {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 2rem auto 0;
    max-width: 26rem;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.auth-page {
    min-height: 100vh;
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.auth-page > .row,
.auth-page > .d-flex,
.auth-page > .auth-panel {
    width: 100%;
}

.auth-panel h1,
.dashboard-page h1,
.chat-page h1,
.dashboard-panel h2 {
    color: var(--burgundy-900);
}

.auth-panel::before {
    background: linear-gradient(90deg, var(--rose-600), #d992a5);
    border-radius: 8px 8px 0 0;
    content: "";
    display: block;
    height: 4px;
    margin: -1.25rem -1.25rem 1.25rem;
}

.wizard-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.wizard-tabs a {
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #5b2638;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
}

.wizard-tabs a.active {
    color: #fff;
    background: var(--rose-600);
    border-color: var(--rose-600);
}

.dashboard-page {
    min-height: 100vh;
    padding-top: 5rem !important;
    padding-left: max(var(--bs-gutter-x, 0.75rem), env(safe-area-inset-left));
    padding-right: max(var(--bs-gutter-x, 0.75rem), env(safe-area-inset-right));
}

.admin-brand-title {
    align-items: center;
    display: flex;
    gap: 0.85rem;
}

.admin-brand-title img {
    background: transparent;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    flex: 0 0 116px;
    height: 64px;
    object-fit: contain;
    padding: 0.25rem;
    width: 116px;
}

.admin-brand-name {
    color: var(--rose-700);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.1rem;
    text-transform: uppercase;
}

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

.metric-card,
.dashboard-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.metric-card {
    padding: 1rem;
    position: relative;
}

.metric-card::before {
    background: linear-gradient(180deg, var(--rose-500), #e7a1b2);
    border-radius: 8px 0 0 8px;
    content: "";
    inset: 0 auto 0 0;
    position: absolute;
    width: 4px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.65rem;
}

.dashboard-panel {
    padding: 1.25rem;
    min-height: 220px;
}

.list-row {
    padding: 0.85rem 0;
    border-top: 1px solid #f0e7eb;
}

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

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

.list-row span {
    color: var(--muted);
    font-size: 0.95rem;
}

.places-map {
    width: 100%;
    height: 460px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
}

.proposal-choice {
    display: block;
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.proposal-choice:hover,
.proposal-choice:focus-within {
    border-color: var(--rose-500);
    box-shadow: 0 12px 26px rgba(159, 47, 85, 0.1);
    transform: translateY(-1px);
}

.proposal-choice input {
    margin-right: 0.5rem;
}

.proposal-choice span {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
}

.review-list {
    display: grid;
    gap: 0.75rem;
}

.review-list div {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

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

.review-list span {
    color: var(--muted);
    font-size: 0.9rem;
}

.proposal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1rem;
}

.proposal-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.proposal-card.anonymous {
    border-color: #d4a7b7;
}

.proposal-card-media {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 8rem),
        linear-gradient(135deg, #fbe5eb, #e8ccd5);
    height: 170px;
    overflow: hidden;
}

.proposal-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anonymous-silhouette {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: end center;
    color: #5b2638;
    font-weight: 600;
    padding-bottom: 1rem;
    position: relative;
    text-align: center;
}

.anonymous-silhouette::before {
    background: linear-gradient(180deg, #8d4961, #371722);
    border-radius: 48% 48% 8px 8px;
    content: "";
    height: 78px;
    left: 50%;
    position: absolute;
    top: 58px;
    transform: translateX(-50%);
    width: 82px;
}

.anonymous-silhouette::after {
    background: linear-gradient(180deg, #a15770, #562236);
    border-radius: 50%;
    content: "";
    height: 44px;
    left: 50%;
    position: absolute;
    top: 22px;
    transform: translateX(-50%);
    width: 44px;
}

.proposal-card-body {
    padding: 1rem;
}

.proposal-meta {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}

.proposal-meta div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid #f0e7eb;
    padding-top: 0.5rem;
}

.proposal-meta dt {
    color: var(--muted);
    font-weight: 500;
}

.proposal-meta dd {
    margin: 0;
    text-align: right;
}

.verified-badge {
    background: #14624f;
    color: #fff;
}

.offer-form {
    border-top: 1px solid #f0e7eb;
    padding-top: 1rem;
}

.offer-inbox {
    display: grid;
    gap: 1rem;
}

.offer-inbox-item {
    min-height: auto;
}

.chat-list-item {
    color: inherit;
    display: block;
    min-height: auto;
    text-decoration: none;
}

.chat-list-item:hover {
    border-color: #d7a7b9;
}

.chat-shell {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: min(62vh, 640px);
    overflow-y: auto;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 247, 249, 0.96), rgba(255, 255, 255, 0.96));
}

.chat-message {
    display: flex;
}

.chat-message.mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(78%, 620px);
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.chat-message.mine .chat-bubble {
    background: #fff2f5;
    border-color: var(--rose-600);
}

.chat-bubble p {
    margin: 0.25rem 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-bubble img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
}

.chat-bubble audio {
    display: block;
    width: min(280px, 100%);
}

.chat-bubble small,
.chat-sender {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.chat-compose {
    background: rgba(255, 255, 255, 0.82);
    border-top: 1px solid var(--line);
    padding: 1rem;
}

.temporary-chat-panel {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.temporary-chat-panel span {
    display: block;
}

.dataTables_wrapper .dt-input,
.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select {
    border-color: #dbc3cb;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .auth-panel {
        padding: 2rem;
    }

    .auth-panel::before {
        margin: -2rem -2rem 2rem;
    }

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

@media (max-width: 767.98px) {
    body {
        background:
            radial-gradient(circle at top, rgba(255, 221, 229, 0.86), transparent 24rem),
            linear-gradient(180deg, #fff9fa 0%, #fff 100%);
    }

    .home-hero {
        min-height: auto;
        padding: 5.25rem 0 2rem;
    }

    .app-corner-brand {
        left: 0.75rem;
        top: 0.55rem;
        width: 118px;
    }

    .app-corner-brand img {
        height: 38px;
        width: 114px;
    }

    .app-loader-card img {
        height: 70px;
        width: 220px;
    }

    .home-title {
        max-width: none;
    }

    .home-actions,
    .dashboard-page > .d-flex:first-child > .d-flex,
    .chat-page > .d-flex:first-child > .d-flex {
        width: 100%;
    }

    .home-actions .btn,
    .dashboard-page > .d-flex:first-child > .d-flex .btn,
    .chat-page > .d-flex:first-child > .d-flex .btn,
    .chat-page > .d-flex:first-child > .d-flex form,
    .chat-page > .d-flex:first-child > .d-flex form .btn {
        flex: 1 1 auto;
    }

    .dashboard-panel {
        min-height: auto;
        padding: 1rem;
    }

    .chat-messages {
        height: 58vh;
        padding: 0.75rem;
    }

    .chat-bubble {
        max-width: 92%;
    }

    .temporary-chat-panel {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loader-card img {
        animation: none;
    }
}
