:root {
    --bs-primary: #23614d;
    --bs-primary-rgb: 35, 97, 77;
    --bs-success: #23614d;
    --bs-success-rgb: 35, 97, 77;
    --portal-ink: #18231f;
    --portal-muted: #68736f;
    --portal-green: #23614d;
    --portal-green-dark: #174536;
    --portal-green-soft: #e8f1ed;
    --portal-canvas: #f5f6f3;
    --portal-surface: #ffffff;
    --portal-border: #e3e8e4;
    --portal-warning: #9a6700;
    --portal-warning-bg: #fff7df;
    --portal-shadow: 0 12px 35px rgba(28, 51, 42, 0.07);
}

html {
    scroll-behavior: smooth;
}

body.portal-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 95% 0%, rgba(35, 97, 77, 0.07), transparent 28rem),
        var(--portal-canvas);
    color: var(--portal-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--portal-green);
    text-decoration: none;
}

a:hover {
    color: var(--portal-green-dark);
}

.text-primary { color: var(--portal-green) !important; }
.bg-primary, .bg-success { background-color: var(--portal-green) !important; }

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 70px;
    padding: 0.8rem 0;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(227, 232, 228, 0.9);
    box-shadow: 0 6px 24px rgba(28, 51, 42, 0.04);
    backdrop-filter: blur(14px);
}

.portal-topbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    margin: 0;
}

.portal-brand-label {
    padding-left: 0.9rem;
    border-left: 1px solid var(--portal-border);
    color: var(--portal-muted);
    font-size: 0.82rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

.portal-topbar-user {
    display: grid;
    line-height: 1.2;
    text-align: right;
}

.portal-topbar-user span {
    color: var(--portal-muted);
    font-size: 0.72rem;
}

.portal-topbar-user strong {
    font-size: 0.9rem;
}

.portal-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--portal-border);
    border-radius: 0.7rem;
    color: var(--portal-ink);
    font-size: 0.85rem;
}

.portal-menu-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(35, 97, 77, 0.14);
}

.portal-container {
    width: min(100% - 2rem, 1540px);
    max-width: none;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.portal-topbar > .container,
.portal-footer > .container {
    width: min(100% - 2rem, 1540px);
    max-width: none;
}

.portal-payment-alert {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    color: #624400;
    background: var(--portal-warning-bg);
    border: 1px solid #f1dfa5;
    border-radius: 0.85rem;
    font-size: 0.9rem;
}

.portal-payment-alert > i { font-size: 1.15rem; }
.portal-payment-alert .alert-link { margin-left: auto; white-space: nowrap; }

.card {
    overflow: hidden;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    box-shadow: var(--portal-shadow);
}

.card-header {
    padding: 1.1rem 1.25rem;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.card-header h5,
.card-header h6 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

.card-body { padding: 1.25rem; }

.portal-sidebar {
    position: sticky;
    top: 94px;
    overflow: visible;
    box-shadow: 0 8px 28px rgba(28, 51, 42, 0.05);
}

.portal-sidebar .card-body { padding: 1rem; }

.profile-avatar {
    width: 76px;
    height: 76px;
    object-fit: cover;
    background: var(--portal-green-soft);
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--portal-border), 0 8px 20px rgba(28, 51, 42, 0.12);
}

.portal-account-link {
    margin-bottom: 0.75rem;
    color: var(--portal-muted);
    font-size: 0.78rem;
}

.list-group {
    gap: 0.25rem;
}

.list-group-item {
    border: 0;
    border-radius: 0.7rem !important;
}

.portal-sidebar .list-group-item,
.portal-offcanvas .list-group-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    color: #45514c;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 550;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.portal-sidebar .list-group-item i,
.portal-offcanvas .list-group-item i {
    width: 1.35rem;
    margin-right: 0.55rem;
    color: #87908c;
    font-size: 1rem;
}

.portal-sidebar .list-group-item:hover,
.portal-offcanvas .list-group-item:hover {
    color: var(--portal-green-dark);
    background: #f4f7f5;
}

.portal-sidebar .list-group-item.active,
.portal-offcanvas .list-group-item.active {
    color: var(--portal-green-dark) !important;
    background: var(--portal-green-soft) !important;
    box-shadow: inset 0 0 0 1px rgba(35, 97, 77, 0.12), 0 6px 14px rgba(28, 51, 42, 0.06);
}

.portal-sidebar .list-group-item.active i,
.portal-offcanvas .list-group-item.active i { color: var(--portal-green); }

.portal-offcanvas { max-width: 310px; }
.portal-offcanvas .offcanvas-header { border-bottom: 1px solid var(--portal-border); }

h1, h2, h3, h4, h5, h6 { color: var(--portal-ink); }
h1, h2, h3, h4 { letter-spacing: -0.025em; }

.col-lg-9 > .d-flex:first-child h4,
.col-lg-9 > h1:first-child {
    font-size: clamp(1.55rem, 2vw, 2rem);
    font-weight: 750;
}

.portal-page-heading h1 {
    margin: 0.25rem 0 0.35rem;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 760;
}

.portal-page-heading p {
    margin: 0;
    color: var(--portal-muted);
}

.portal-eyebrow {
    color: var(--portal-green);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-stats .card-body {
    position: relative;
    display: grid;
    gap: 0.25rem;
    min-height: 155px;
}

.portal-stats .card-body > span {
    color: var(--portal-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.portal-stats .card-body > strong {
    font-size: 2rem;
    line-height: 1.1;
}

.portal-stats .card-body > small {
    align-self: end;
    color: var(--portal-green);
    font-weight: 650;
}

.portal-stat-icon {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.75rem;
}

.portal-empty-state .card-body {
    max-width: 460px;
    margin: auto;
    padding: 3.5rem 1.5rem;
}

.portal-empty-state .card-body > i {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 1rem;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 1rem;
    font-size: 1.4rem;
}

.portal-empty-state p,
.portal-table-empty { color: var(--portal-muted); }

.portal-table-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 90px;
    font-size: 0.9rem;
}

.portal-table-empty i { color: var(--portal-green); font-size: 1.1rem; }

.portal-team-card {
    gap: 1rem;
    padding: 1rem;
    background: #fbfcfb;
    border: 1px solid var(--portal-border);
    border-radius: 0.9rem;
}

.portal-team-avatar {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    object-fit: cover;
    background: var(--portal-green-soft);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--portal-border);
}

.portal-team-name {
    font-size: 1rem;
    font-weight: 720;
}

.portal-team-role {
    margin: 0.1rem 0 0.55rem;
    color: var(--portal-muted);
    font-size: 0.8rem;
}

.portal-team-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.portal-team-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 650;
}

.btn {
    border-radius: 0.7rem;
    font-weight: 650;
}

.btn-primary {
    color: #fff;
    background: var(--portal-green) !important;
    border-color: var(--portal-green) !important;
    box-shadow: 0 6px 14px rgba(35, 97, 77, 0.15);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: var(--portal-green-dark) !important;
    border-color: var(--portal-green-dark) !important;
}

.btn-outline-primary {
    color: var(--portal-green);
    border-color: var(--portal-green);
}

.progress {
    height: 0.55rem;
    overflow: hidden;
    background: #e9eeeb;
    border-radius: 999px;
}

.progress-bar {
    overflow: visible;
    color: transparent;
    background: linear-gradient(90deg, var(--portal-green), #4d9075) !important;
    border-radius: inherit;
}

.table {
    margin-bottom: 0;
    color: var(--portal-ink);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.8rem;
    border-bottom-color: #edf0ee;
}

.table thead th {
    color: var(--portal-muted);
    background: #fafbfa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background-color: #f7faf8; }

.badge {
    padding: 0.5em 0.7em;
    border-radius: 999px;
    font-weight: 650;
}

.alert {
    border: 1px solid transparent;
    border-radius: 0.85rem;
}

.alert-info {
    color: #3e6255;
    background: #eef5f1;
    border-color: #dbe9e2;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: #dce3df;
    border-radius: 0.7rem;
}

textarea.form-control { min-height: 110px; }

.form-control:focus,
.form-select:focus {
    border-color: #78a692;
    box-shadow: 0 0 0 0.2rem rgba(35, 97, 77, 0.1);
}

.input-group-text {
    background: #f8faf9;
    border-color: #dce3df;
}

/* Customer project detail */
.project-detail-back { margin-bottom: 0.85rem; }

.project-detail-flash {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.project-detail-flash .btn-close { margin-left: auto; }

.project-detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 2rem;
    align-items: stretch;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    color: #fff;
    background:
        radial-gradient(circle at 88% 8%, rgba(255, 255, 255, 0.1), transparent 13rem),
        linear-gradient(135deg, #173b30, #225d4a 70%, #32735c);
    border-radius: 1.2rem;
    box-shadow: 0 18px 48px rgba(20, 56, 45, 0.2);
}

.project-detail-hero::after {
    position: absolute;
    right: -6rem;
    bottom: -8rem;
    width: 20rem;
    height: 20rem;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.025), 0 0 0 6rem rgba(255, 255, 255, 0.018);
}

.project-detail-hero-main,
.project-detail-hero-side { position: relative; z-index: 1; }

.project-detail-kicker {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.9rem;
    color: #b9d8cc;
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.project-detail-kicker span:last-child {
    padding: 0.25rem 0.5rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.project-detail-title-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.project-detail-stage-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 54px;
    height: 54px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 0.95rem;
    font-size: 1.25rem;
}

.project-detail-title-row h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    font-weight: 770;
    line-height: 1.08;
}

.project-detail-title-row p { margin: 0.28rem 0 0; color: rgba(255, 255, 255, 0.7); font-size: 0.8rem; }

.project-detail-progress-heading {
    display: flex;
    justify-content: space-between;
    max-width: 650px;
    margin: 1.5rem 0 0.5rem;
    color: #c8ddd5;
    font-size: 0.68rem;
}

.project-detail-progress-heading strong { color: #fff; font-size: 0.78rem; }

.project-detail-progress {
    max-width: 650px;
    height: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.project-detail-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #d7b769, #f1dc9d);
    border-radius: inherit;
    box-shadow: 0 0 18px rgba(240, 214, 146, 0.25);
}

.project-detail-hero-side {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-left: 2rem;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.project-detail-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.65rem;
    color: #173b30;
    background: #fff;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
}

.project-detail-hero-side p { margin: 0.75rem 0 1rem; color: rgba(255, 255, 255, 0.7); font-size: 0.75rem; line-height: 1.5; }

.project-detail-hero-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.72rem;
}

.project-detail-hero-action:hover { color: #173b30; background: #fff; border-color: #fff; }

.project-detail-layout { --bs-gutter-y: 1.5rem; }
.project-detail-sticky { position: sticky; top: 94px; }

.project-detail-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-detail-section-heading h2,
.project-summary-card h2,
.project-detail-warranty h2 {
    margin: 0.2rem 0 0;
    font-size: 1.07rem;
    font-weight: 740;
}

.project-detail-section-count {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 0.45rem;
    color: var(--portal-green-dark);
    background: var(--portal-green-soft);
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 750;
}

.project-stage-timeline {
    position: relative;
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-stage-timeline::before {
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 21px;
    width: 2px;
    content: "";
    background: #dfe8e3;
}

.project-stage-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    min-height: 72px;
    padding: 0.65rem 0;
}

.project-stage-marker {
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--portal-green);
    background: #edf5f1;
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #d9e6df;
}

.project-stage-timeline li.is-current .project-stage-marker {
    color: #fff;
    background: var(--portal-green);
    box-shadow: 0 0 0 1px var(--portal-green), 0 6px 16px rgba(35, 97, 77, 0.2);
}

.project-stage-timeline li > div { display: grid; }
.project-stage-timeline li > div > span { color: var(--portal-green); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; }
.project-stage-timeline li > div > strong { margin-top: 0.05rem; font-size: 0.86rem; }
.project-stage-timeline time { margin-top: 0.15rem; color: var(--portal-muted); font-size: 0.66rem; }
.project-stage-timeline li > small { padding: 0.35rem 0.55rem; color: var(--portal-green-dark); background: var(--portal-green-soft); border-radius: 999px; font-size: 0.62rem; font-weight: 700; }

.project-detail-empty {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 82px;
    padding: 0.85rem;
    color: var(--portal-muted);
    background: #f7f9f8;
    border: 1px dashed #d5dfda;
    border-radius: 0.8rem;
}

.project-detail-empty > i { color: var(--portal-green); font-size: 1.2rem; }
.project-detail-empty > div { display: grid; }
.project-detail-empty strong { color: var(--portal-ink); font-size: 0.8rem; }
.project-detail-empty span { margin-top: 0.1rem; font-size: 0.69rem; }

.project-file-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }

.project-file-card {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    min-height: 72px;
    padding: 0.65rem;
    color: var(--portal-ink);
    background: #f8faf9;
    border: 1px solid #e8eeea;
    border-radius: 0.8rem;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.project-file-card:hover { color: var(--portal-ink); transform: translateY(-2px); background: #fff; border-color: #bfd3c9; }
.project-file-card > img { width: 50px; height: 50px; object-fit: cover; background: #edf2ef; border-radius: 0.6rem; }

.project-file-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.6rem;
}

.project-file-icon i { font-size: 1.15rem; }
.project-file-icon small { margin-top: -0.2rem; font-size: 0.5rem; font-weight: 750; }
.project-file-copy { display: grid; min-width: 0; }
.project-file-copy strong { overflow: hidden; font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.project-file-copy small { margin-top: 0.15rem; overflow: hidden; color: var(--portal-muted); font-size: 0.58rem; text-overflow: ellipsis; white-space: nowrap; }
.project-file-open { color: #95a09b; font-size: 0.72rem; }

.project-location-body { display: grid; gap: 0.8rem; }
.project-location-address { display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem; background: #f7f9f8; border-radius: 0.75rem; }
.project-location-address > i { display: grid; place-items: center; width: 36px; height: 36px; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 0.65rem; }
.project-location-address > span { display: grid; }
.project-location-address small { color: var(--portal-muted); font-size: 0.6rem; }
.project-location-address strong { font-size: 0.78rem; }
.project-location-map { width: 100%; height: 290px; overflow: hidden; border: 1px solid var(--portal-border); border-radius: 0.85rem; }

.project-note-list { display: grid; gap: 0.8rem; }
.project-note { display: flex; gap: 0.75rem; max-width: 90%; }
.project-note.is-customer { align-self: flex-end; flex-direction: row-reverse; justify-self: end; }
.project-note-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 50%; }
.project-note-avatar img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; }
.project-note.is-customer .project-note-avatar { color: #fff; background: var(--portal-green); }

.project-note-content {
    min-width: 0;
    padding: 0.75rem 0.85rem;
    background: #f2f5f3;
    border-radius: 0.2rem 0.85rem 0.85rem;
}

.project-note.is-customer .project-note-content { color: #fff; background: var(--portal-green); border-radius: 0.85rem 0.2rem 0.85rem 0.85rem; }
.project-note.is-new .project-note-content { box-shadow: 0 0 0 3px rgba(35, 97, 77, 0.13); }
.project-note-meta { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.4rem 1rem; }
.project-note-meta > span { display: grid; }
.project-note-meta strong { font-size: 0.72rem; }
.project-note-meta small,
.project-note-meta time { color: var(--portal-muted); font-size: 0.58rem; }
.project-note.is-customer .project-note-meta small,
.project-note.is-customer .project-note-meta time { color: rgba(255, 255, 255, 0.68); }
.project-note-content p { margin: 0.55rem 0 0; font-size: 0.78rem; line-height: 1.55; }

.project-note-form { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--portal-border); }
.project-note-form textarea { min-height: 95px; }
.project-note-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.project-note-form-footer small { color: var(--portal-muted); font-size: 0.65rem; }
.project-note-form-footer .btn { display: inline-flex; align-items: center; gap: 0.35rem; }

.project-summary-card .card-body { padding: 1.3rem; }
.project-summary-list { margin: 1rem 0 0; }
.project-summary-list > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #edf0ee; }
.project-summary-list > div:last-child { border-bottom: 0; }
.project-summary-list dt { color: var(--portal-muted); font-size: 0.68rem; font-weight: 550; }
.project-summary-list dt i { width: 1rem; margin-right: 0.3rem; color: #87938e; }
.project-summary-list dd { margin: 0; font-size: 0.72rem; font-weight: 700; text-align: right; }
.project-summary-address { display: flex; gap: 0.45rem; margin: 0.75rem 0 0; padding: 0.65rem; color: var(--portal-muted); background: #f6f8f7; border-radius: 0.65rem; font-size: 0.64rem; line-height: 1.4; }
.project-summary-address i { flex: 0 0 auto; color: var(--portal-green); }

.project-team-panel .card-body { padding: 0.5rem 1rem 1rem; }
.project-team-list { display: grid; }
.project-team-member { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--portal-border); }
.project-team-member:last-child { border-bottom: 0; }
.project-team-member > img { width: 44px; height: 44px; object-fit: cover; background: var(--portal-green-soft); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--portal-border); }
.project-team-member > div:nth-child(2) { display: grid; min-width: 0; }
.project-team-member strong { overflow: hidden; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.project-team-member span { color: var(--portal-muted); font-size: 0.62rem; }
.project-team-contact { display: flex; gap: 0.35rem; }
.project-team-contact a { display: grid; place-items: center; width: 32px; height: 32px; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 0.55rem; font-size: 0.75rem; }
.project-team-contact a:hover { color: #fff; background: var(--portal-green); }
.project-team-empty { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0; color: var(--portal-muted); font-size: 0.68rem; }
.project-team-empty i { color: var(--portal-green); font-size: 1rem; }

.project-detail-warranty .card-body { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0.75rem; padding: 1.2rem; }
.project-detail-warranty-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 0.8rem; font-size: 1.05rem; }
.project-detail-warranty p { margin: 0.4rem 0 0; color: var(--portal-muted); font-size: 0.7rem; }
.project-detail-warranty small { display: block; margin-top: 0.15rem; color: var(--portal-green); font-size: 0.64rem; font-weight: 650; }
.project-detail-warranty .btn { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 0.25rem; font-size: 0.72rem; }

/* Customer project hub */
.project-hub-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
}

.project-hub-heading .btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4rem;
}

.project-hub-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.project-hub-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 88px;
    padding: 1rem 1.1rem;
    color: var(--portal-ink);
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(28, 51, 42, 0.045);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-hub-stat:hover {
    color: var(--portal-ink);
    transform: translateY(-2px);
    border-color: #c6d9cf;
    box-shadow: 0 13px 30px rgba(28, 51, 42, 0.08);
}

.project-hub-stat-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.8rem;
    font-size: 1.1rem;
}

.project-hub-stat.is-completed .project-hub-stat-icon {
    color: #80601f;
    background: #fff3d6;
}

.project-hub-stat > span:nth-child(2) { display: grid; }
.project-hub-stat strong { font-size: 1.35rem; line-height: 1.05; }
.project-hub-stat small { margin-top: 0.15rem; color: var(--portal-muted); font-size: 0.72rem; }
.project-hub-stat-arrow { margin-left: auto; color: #9aa39f; font-size: 0.8rem; }

.project-hub-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 94px;
}

.project-hub-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-hub-section-heading h2 {
    margin: 0.2rem 0 0.2rem;
    font-size: 1.35rem;
    font-weight: 750;
}

.project-hub-section-heading p { margin: 0; color: var(--portal-muted); font-size: 0.78rem; }

.project-hub-count {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.55rem;
    color: var(--portal-green-dark);
    background: var(--portal-green-soft);
    border: 1px solid #d5e4dc;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 750;
}

.project-hub-grid,
.project-completed-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-hub-card {
    position: relative;
    display: flex;
    min-height: 390px;
    padding: 1.25rem;
    flex-direction: column;
    overflow: hidden;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    box-shadow: var(--portal-shadow);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-hub-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, var(--portal-green), #61a287);
}

.project-hub-card:hover {
    transform: translateY(-3px);
    border-color: #c8d9d0;
    box-shadow: 0 18px 40px rgba(28, 51, 42, 0.1);
}

.project-hub-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.project-hub-stage-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.75rem;
    font-size: 1.05rem;
}

.project-hub-stage {
    padding: 0.38rem 0.62rem;
    color: #28634f;
    background: #edf6f1;
    border: 1px solid #d9e9e1;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
}

.project-hub-card-title { padding: 1.2rem 0 1rem; }
.project-hub-card-title > span { color: var(--portal-muted); font-size: 0.67rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.project-hub-card-title h3 { margin: 0.3rem 0 0; font-size: 1.3rem; font-weight: 750; line-height: 1.25; }

.project-hub-progress-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.project-hub-progress-heading > div { display: grid; }
.project-hub-progress-heading div span { color: var(--portal-muted); font-size: 0.65rem; }
.project-hub-progress-heading div strong { margin-top: 0.05rem; font-size: 0.82rem; }
.project-hub-percentage { color: var(--portal-green); font-size: 0.78rem; font-weight: 750; }

.project-hub-progress {
    height: 8px;
    overflow: hidden;
    background: #e7ede9;
    border-radius: 999px;
}

.project-hub-progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--portal-green), #5c9c81);
    border-radius: inherit;
}

.project-hub-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 1rem;
}

.project-hub-dates > div {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.7rem;
    background: #f7f9f8;
    border: 1px solid #ebefec;
    border-radius: 0.75rem;
}

.project-hub-dates i { flex: 0 0 auto; color: #7b8b84; }
.project-hub-dates div span { display: grid; min-width: 0; color: var(--portal-muted); font-size: 0.61rem; }
.project-hub-dates strong { overflow: hidden; color: var(--portal-ink); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }

.project-hub-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.1rem;
}

.project-hub-card-actions .btn { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; }
.project-hub-edit,
.project-hub-update-note { color: var(--portal-muted); font-size: 0.68rem; font-weight: 600; }
.project-hub-edit { color: var(--portal-green); }
.project-hub-edit i,
.project-hub-update-note i { margin-right: 0.2rem; }

.project-completed-card {
    display: flex;
    padding: 1.2rem;
    flex-direction: column;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    box-shadow: var(--portal-shadow);
}

.project-completed-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.project-completed-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 48px;
    height: 48px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.85rem;
    font-size: 1.15rem;
}

.project-completed-main > div > span { color: var(--portal-muted); font-size: 0.64rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.project-completed-main h3 { margin: 0.15rem 0; font-size: 1.08rem; font-weight: 740; }
.project-completed-main small { color: #4d7667; font-size: 0.66rem; }
.project-completed-main small i { margin-right: 0.25rem; color: var(--portal-green); }

.project-warranty-summary {
    margin: 1rem 0;
    padding: 0.85rem;
    color: #4b665c;
    background: #f1f7f4;
    border: 1px solid #dceae3;
    border-radius: 0.8rem;
}

.project-warranty-summary.is-expired { color: #74645f; background: #f7f4f2; border-color: #e8dfdb; }
.project-warranty-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.project-warranty-heading span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
.project-warranty-heading span i { margin-right: 0.3rem; }
.project-warranty-heading strong { color: var(--portal-green); font-size: 0.7rem; }
.project-warranty-summary.is-expired .project-warranty-heading strong { color: #8a5953; }
.project-warranty-summary p { margin: 0.55rem 0 0; font-size: 0.75rem; }
.project-warranty-summary p strong { color: var(--portal-ink); }
.project-warranty-summary > small { display: block; margin-top: 0.15rem; color: var(--portal-muted); font-size: 0.65rem; }

.project-completed-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; margin-top: auto; }
.project-completed-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; font-size: 0.72rem; }

.project-hub-section-empty {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 105px;
    padding: 1.1rem;
    color: var(--portal-muted);
    background: rgba(255, 255, 255, 0.65);
    border: 1px dashed #cedad4;
    border-radius: 0.9rem;
}

.project-hub-section-empty > span { display: grid; place-items: center; width: 42px; height: 42px; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 0.75rem; }
.project-hub-section-empty > div { display: grid; }
.project-hub-section-empty strong { color: var(--portal-ink); font-size: 0.82rem; }
.project-hub-section-empty p { margin: 0.15rem 0 0; font-size: 0.72rem; }
.project-hub-empty h2 { font-size: 1.3rem; font-weight: 750; }

/* Customer quotation library */
.quotation-library-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
}

.quotation-library-total {
    flex: 0 0 auto;
    padding: 0.55rem 0.8rem;
    color: var(--portal-muted);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--portal-border);
    border-radius: 0.75rem;
    font-size: 0.75rem;
    box-shadow: 0 5px 16px rgba(28, 51, 42, 0.04);
}

.quotation-library-total strong {
    margin-right: 0.15rem;
    color: var(--portal-ink);
    font-size: 0.95rem;
}

.quotation-library-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.25rem;
}

.quotation-library-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 82px;
    padding: 1rem 1.1rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 0.95rem;
    box-shadow: 0 8px 24px rgba(28, 51, 42, 0.045);
}

.quotation-library-stat-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #8c651c;
    background: #fff3d3;
    border-radius: 0.75rem;
    font-size: 1.05rem;
}

.quotation-library-stat.is-complete .quotation-library-stat-icon {
    color: var(--portal-green);
    background: var(--portal-green-soft);
}

.quotation-library-stat > div { display: grid; }
.quotation-library-stat strong { font-size: 1.25rem; line-height: 1.1; }
.quotation-library-stat div span { margin-top: 0.12rem; color: var(--portal-muted); font-size: 0.72rem; }

.quotation-library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quotation-library-search {
    display: flex;
    flex: 1 1 230px;
    align-items: center;
    gap: 0.55rem;
    max-width: 290px;
    min-height: 42px;
    padding: 0 0.75rem;
    color: #89938f;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 14px rgba(28, 51, 42, 0.035);
}

.quotation-library-search:focus-within {
    color: var(--portal-green);
    border-color: #78a692;
    box-shadow: 0 0 0 0.2rem rgba(35, 97, 77, 0.1);
}

.quotation-library-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    color: var(--portal-ink);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 0.76rem;
}

.quotation-library-search input::placeholder { color: #99a29e; }

.quotation-library-filters {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: #e9eeeb;
    border-radius: 0.8rem;
}

.quotation-library-filters button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    color: #63706b;
    white-space: nowrap;
    background: transparent;
    border: 0;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 650;
}

.quotation-library-filters button span {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.3rem;
    color: #73807b;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    font-size: 0.62rem;
}

.quotation-library-filters button:hover { color: var(--portal-green-dark); }

.quotation-library-filters button.active {
    color: var(--portal-green-dark);
    background: #fff;
    box-shadow: 0 3px 10px rgba(28, 51, 42, 0.08);
}

.quotation-library-filters button.active span {
    color: var(--portal-green-dark);
    background: var(--portal-green-soft);
}

.quotation-library-filters button:focus-visible {
    outline: 2px solid var(--portal-green);
    outline-offset: 2px;
}

.quotation-library-order {
    flex: 0 0 auto;
    color: var(--portal-muted);
    font-size: 0.72rem;
}

.quotation-library-order i { margin-right: 0.25rem; }

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

.quotation-library-card {
    position: relative;
    display: flex;
    min-height: 265px;
    padding: 1.2rem;
    flex-direction: column;
    overflow: hidden;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    box-shadow: var(--portal-shadow);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.quotation-library-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    content: "";
    background: #a4ada9;
}

.quotation-library-card.is-pending::before { background: #c59133; }
.quotation-library-card.is-success::before { background: var(--portal-green); }
.quotation-library-card.is-warning::before { background: #c59133; }
.quotation-library-card.is-danger::before { background: #b8534c; }
.quotation-library-card[hidden] { display: none; }

.quotation-library-card:hover {
    transform: translateY(-3px);
    border-color: #cbdcd4;
    box-shadow: 0 18px 40px rgba(28, 51, 42, 0.1);
}

.quotation-library-card-top,
.quotation-library-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.quotation-document-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.75rem;
    font-size: 1.1rem;
}

.quotation-library-card.is-pending .quotation-document-icon,
.quotation-library-card.is-warning .quotation-document-icon {
    color: #8c651c;
    background: #fff3d3;
}

.quotation-library-card.is-danger .quotation-document-icon {
    color: #a23d37;
    background: #fae8e6;
}

.quotation-library-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.6rem;
    color: #53615b;
    background: #f2f5f3;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
}

.quotation-library-card.is-pending .quotation-library-status,
.quotation-library-card.is-warning .quotation-library-status { color: #835f1a; background: #fff5dc; }
.quotation-library-card.is-success .quotation-library-status { color: #1f6b50; background: #e3f3eb; }
.quotation-library-card.is-danger .quotation-library-status { color: #9d403a; background: #fae8e6; }

.quotation-library-card-copy { flex: 1; padding: 1.3rem 0; }

.quotation-library-number {
    color: var(--portal-green);
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.quotation-library-card-copy h2 {
    margin: 0.3rem 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 740;
    line-height: 1.25;
}

.quotation-library-card-copy p {
    margin: 0;
    color: var(--portal-muted);
    font-size: 0.78rem;
}

.quotation-library-card-footer {
    padding-top: 0.9rem;
    border-top: 1px solid var(--portal-border);
}

.quotation-library-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--portal-muted);
    font-size: 0.68rem;
}

.quotation-library-date i { color: #8a9691; }
.quotation-library-date time { color: #4f5d57; font-weight: 650; }

.quotation-library-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.73rem;
    font-weight: 700;
}

.quotation-library-open i { transition: transform 160ms ease; }
.quotation-library-open:hover i { transform: translateX(3px); }

.quotation-library-filter-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 2rem;
    color: var(--portal-muted);
    text-align: center;
}

.quotation-library-filter-empty[hidden] { display: none; }
.quotation-library-filter-empty > i { margin-bottom: 0.6rem; color: var(--portal-green); font-size: 1.5rem; }
.quotation-library-filter-empty strong { color: var(--portal-ink); font-size: 0.9rem; }
.quotation-library-filter-empty span { margin-top: 0.15rem; font-size: 0.74rem; }
.quotation-library-empty h2 { font-size: 1.2rem; font-weight: 740; }
.quotation-library-empty .btn { margin-top: 0.5rem; }

@media (min-width: 1400px) {
    .quotation-library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quotation-library-card-footer { align-items: flex-start; flex-direction: column; }
}

/* Customer quotation detail */
.portal-quotation {
    --quotation-navy: #16382e;
    --quotation-gold: #b78a3d;
}

.quotation-back-link { margin-bottom: 0.85rem; }

.quotation-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.35rem);
    color: #fff;
    background:
        radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.1), transparent 12rem),
        linear-gradient(135deg, #16382e, #215c49 72%, #34745e);
    border-radius: 1.25rem;
    box-shadow: 0 18px 48px rgba(20, 56, 45, 0.2);
}

.quotation-hero::after {
    position: absolute;
    right: -3.5rem;
    bottom: -7rem;
    width: 18rem;
    height: 18rem;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    box-shadow: 0 0 0 2.5rem rgba(255, 255, 255, 0.025), 0 0 0 5rem rgba(255, 255, 255, 0.018);
}

.quotation-hero-main,
.quotation-hero-total { position: relative; z-index: 1; }

.quotation-hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
    color: #bad8cc;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.quotation-number {
    padding: 0.28rem 0.55rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    letter-spacing: 0.04em;
}

.quotation-hero h1 {
    max-width: 760px;
    margin: 0;
    color: #fff;
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
    font-weight: 760;
    line-height: 1.08;
}

.quotation-hero-main > p {
    max-width: 620px;
    margin: 0.75rem 0 1.2rem;
    color: rgba(255, 255, 255, 0.72);
}

.quotation-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.2rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
}

.quotation-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.quotation-hero-meta .is-valid { color: #bce8d4; }
.quotation-hero-meta .is-expired { color: #ffd1cc; }

.quotation-hero-total {
    min-width: 230px;
    padding-left: 2rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    text-align: right;
}

.quotation-hero-total > span {
    display: block;
    color: #bad8cc;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quotation-hero-total > strong {
    display: inline-block;
    margin-top: 0.25rem;
    color: #fff;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    line-height: 1.1;
}

.quotation-hero-total > small {
    color: #bad8cc;
    font-size: 0.75rem;
    font-weight: 700;
}

.quotation-hero-total .btn {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
    color: var(--quotation-navy);
    background: #fff !important;
    border-color: #fff !important;
    box-shadow: 0 8px 20px rgba(6, 28, 21, 0.15);
}

.quotation-flash {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.quotation-layout { --bs-gutter-y: 1.5rem; }

.quotation-sticky-panel {
    position: sticky;
    top: 94px;
}

.quotation-section-heading,
.quotation-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.quotation-section-heading h2,
.quotation-summary-heading h2,
.quotation-response-heading h2 {
    margin: 0.2rem 0 0;
    font-size: 1.08rem;
    font-weight: 740;
}

.quotation-item-count {
    flex: 0 0 auto;
    padding: 0.38rem 0.65rem;
    color: var(--portal-muted);
    background: #f3f6f4;
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.quotation-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.quotation-detail {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    align-items: center;
    min-height: 76px;
    padding: 0.85rem;
    background: #f8faf8;
    border: 1px solid #ebefec;
    border-radius: 0.85rem;
}

.quotation-detail > i {
    grid-row: 1 / 3;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--portal-green);
    background: var(--portal-green-soft);
    border-radius: 0.7rem;
}

.quotation-detail > span {
    align-self: end;
    color: var(--portal-muted);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.quotation-detail > strong {
    align-self: start;
    overflow: hidden;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quotation-detail-discount > i {
    color: #8a651e;
    background: #fff4d8;
}

.quotation-items-body { padding: 0; }
.quotation-items-table-wrap { overflow: hidden; }
.quotation-items-table th:first-child,
.quotation-items-table td:first-child { padding-left: 1.25rem; }
.quotation-items-table th:last-child,
.quotation-items-table td:last-child { padding-right: 1.25rem; }
.quotation-items-table td { padding-top: 1rem; padding-bottom: 1rem; }
.quotation-items-table td:first-child { min-width: 165px; }

.quotation-item-section {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--portal-green);
    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.quotation-items-table td:first-child strong,
.quotation-items-table td:first-child small { display: block; }
.quotation-items-table td:first-child small { margin-top: 0.2rem; color: var(--portal-muted); font-size: 0.7rem; }
.quotation-item-description { max-width: 310px; color: var(--portal-muted) !important; font-size: 0.8rem; line-height: 1.55; }
.quotation-items-table td:last-child small { color: var(--portal-muted); font-size: 0.65rem; }

.quotation-mobile-items { padding: 0 1rem; }
.quotation-mobile-item { padding: 1.1rem 0; border-bottom: 1px solid var(--portal-border); }
.quotation-mobile-item:last-child { border-bottom: 0; }

.quotation-mobile-item-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.quotation-mobile-item h3 { margin: 0; font-size: 0.95rem; font-weight: 720; }
.quotation-mobile-item-heading > strong { flex: 0 0 auto; font-size: 0.92rem; }
.quotation-mobile-item-heading > strong small { color: var(--portal-muted); font-size: 0.62rem; }
.quotation-mobile-item p { margin: 0.75rem 0; color: var(--portal-muted); font-size: 0.8rem; line-height: 1.55; }

.quotation-mobile-item-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--portal-muted);
    font-size: 0.72rem;
}

.quotation-mobile-item-meta span {
    padding: 0.3rem 0.5rem;
    background: #f4f7f5;
    border-radius: 0.45rem;
}

.quotation-advisor {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    background: linear-gradient(100deg, #eef5f1, #f9fbfa);
    border: 1px solid #dbe9e2;
    border-radius: 1rem;
}

.quotation-advisor > img {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    object-fit: cover;
    background: #fff;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #d4e1da;
}

.quotation-advisor-copy { flex: 1 1 auto; min-width: 0; }
.quotation-advisor-copy > span { color: var(--portal-green); font-size: 0.65rem; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; }
.quotation-advisor-copy h2 { margin: 0.15rem 0; font-size: 1rem; font-weight: 730; }
.quotation-advisor-copy p { margin: 0; color: var(--portal-muted); font-size: 0.78rem; }
.quotation-advisor-actions { display: flex; flex: 0 0 auto; gap: 0.5rem; }
.quotation-advisor-actions .btn { font-size: 0.78rem; }

.quotation-summary-card { border-color: #d9e4de; }
.quotation-summary-card .card-body { padding: 1.35rem; }

.quotation-print-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--portal-muted);
    background: #f7f9f8;
    border: 1px solid var(--portal-border);
    border-radius: 0.7rem;
}

.quotation-print-button:hover { color: var(--portal-green); border-color: #bfd3c9; }

.quotation-summary-lines { margin: 1.1rem 0 0; }
.quotation-summary-lines > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; color: var(--portal-muted); font-size: 0.8rem; }
.quotation-summary-lines dt { font-weight: 550; }
.quotation-summary-lines dd { margin: 0; color: var(--portal-ink); font-weight: 650; text-align: right; }
.quotation-summary-lines .is-discount dd { color: #946817; }

.quotation-summary-lines .quotation-summary-total {
    align-items: end;
    margin-top: 0.35rem;
    padding-top: 1rem;
    color: var(--portal-ink);
    border-top: 1px solid var(--portal-border);
}

.quotation-summary-total dt { font-size: 0.9rem; font-weight: 720; }
.quotation-summary-total dd strong { font-size: 1.45rem; letter-spacing: -0.025em; }
.quotation-summary-total dd small { color: var(--portal-muted); font-size: 0.65rem; }

.quotation-summary-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.85rem 0 0;
    padding: 0.7rem;
    color: #557067;
    background: #f2f7f4;
    border-radius: 0.7rem;
    font-size: 0.7rem;
    line-height: 1.45;
}

.quotation-summary-note i { color: var(--portal-green); font-size: 0.9rem; }

.quotation-response-card { scroll-margin-top: 94px; }
.quotation-response-card .card-body { padding: 1.35rem; }

.quotation-response-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quotation-response-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #6c746f;
    background: #f0f2f1;
    border-radius: 0.8rem;
}

.quotation-response-icon.is-success { color: #1f6b50; background: #e3f3eb; }
.quotation-response-icon.is-warning { color: #8c651c; background: #fff3d3; }
.quotation-response-icon.is-danger { color: #a23d37; background: #fae8e6; }
.quotation-response-description { margin: 0.9rem 0 0; color: var(--portal-muted); font-size: 0.8rem; line-height: 1.5; }
.quotation-response-date { display: block; margin-top: 0.4rem; color: #88918d; font-size: 0.68rem; }

.quotation-current-feedback {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.8rem;
    color: #4d5e57;
    background: #f7f9f8;
    border-left: 3px solid #b5c9bf;
    border-radius: 0 0.6rem 0.6rem 0;
    font-size: 0.75rem;
}

.quotation-approve-button { width: 100%; margin-top: 1.1rem; padding: 0.72rem 1rem; }
.quotation-response-divider { display: flex; align-items: center; gap: 0.65rem; margin: 1rem 0 0.65rem; color: #99a19e; font-size: 0.65rem; text-transform: uppercase; }
.quotation-response-divider::before,
.quotation-response-divider::after { flex: 1; height: 1px; content: ""; background: var(--portal-border); }

.quotation-response-options { --bs-accordion-border-color: transparent; --bs-accordion-border-width: 0; }
.quotation-response-options .accordion-item { border-top: 1px solid var(--portal-border); border-radius: 0; }
.quotation-response-options .accordion-item:first-child { border-top: 0; }
.quotation-response-options .accordion-button { gap: 0.7rem; padding: 0.8rem 0; color: var(--portal-ink); background: transparent; box-shadow: none; }
.quotation-response-options .accordion-button::after { width: 0.85rem; height: 0.85rem; background-size: 0.85rem; }
.quotation-response-options .accordion-button > i { color: var(--portal-green); }
.quotation-response-options .accordion-button > span { display: grid; gap: 0.05rem; }
.quotation-response-options .accordion-button strong { font-size: 0.78rem; }
.quotation-response-options .accordion-button small { color: var(--portal-muted); font-size: 0.66rem; font-weight: 450; }
.quotation-response-options .quotation-decline-toggle > i { color: #a14b45; }
.quotation-response-options .accordion-body { padding: 0.2rem 0 1rem; }
.quotation-response-options .form-label { font-size: 0.75rem; font-weight: 650; }
.quotation-response-options textarea { min-height: 100px; font-size: 0.8rem; }

.quotation-messages { display: grid; gap: 0.75rem; }
.quotation-message { max-width: 86%; padding: 0.8rem 0.9rem; background: #f2f5f3; border-radius: 0.85rem 0.85rem 0.85rem 0.2rem; }
.quotation-message.is-customer { justify-self: end; color: #fff; background: var(--portal-green); border-radius: 0.85rem 0.85rem 0.2rem 0.85rem; }
.quotation-message-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; align-items: baseline; }
.quotation-message-meta strong { font-size: 0.75rem; }
.quotation-message-meta time { color: var(--portal-muted); font-size: 0.62rem; }
.quotation-message.is-customer .quotation-message-meta time { color: rgba(255, 255, 255, 0.68); }
.quotation-message p { margin: 0.35rem 0 0; font-size: 0.8rem; line-height: 1.5; }

.quotation-no-messages { display: flex; align-items: center; gap: 0.8rem; padding: 1rem; color: var(--portal-muted); background: #f7f9f8; border: 1px dashed #d7dfda; border-radius: 0.8rem; }
.quotation-no-messages > i { color: var(--portal-green); font-size: 1.2rem; }
.quotation-no-messages > div { display: grid; }
.quotation-no-messages strong { color: var(--portal-ink); font-size: 0.82rem; }
.quotation-no-messages span { font-size: 0.72rem; }

.quotation-note-form { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--portal-border); }
.quotation-note-form textarea { min-height: 90px; }
.quotation-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.quotation-form-footer small { color: var(--portal-muted); font-size: 0.68rem; }

.quotation-confirm-modal { border: 0; border-radius: 1.1rem; box-shadow: 0 26px 80px rgba(16, 45, 36, 0.25); }
.quotation-confirm-modal .modal-body { padding: 2rem; text-align: center; }
.quotation-confirm-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 1rem; color: var(--portal-green); background: var(--portal-green-soft); border-radius: 1rem; font-size: 1.55rem; }
.quotation-confirm-modal h2 { margin-bottom: 0.55rem; font-size: 1.35rem; font-weight: 750; }
.quotation-confirm-modal p { margin: 0 auto; color: var(--portal-muted); font-size: 0.88rem; }
.quotation-confirm-actions { display: flex; justify-content: center; gap: 0.65rem; margin-top: 1.35rem; }
.quotation-confirm-actions form { margin: 0; }

.hover-shadow {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.hover-shadow:hover {
    transform: translateY(-3px);
    border-color: #cbdcd4;
    box-shadow: 0 16px 34px rgba(28, 51, 42, 0.11) !important;
}

.portal-footer {
    padding: 1.25rem 0 2rem;
    color: var(--portal-muted);
    font-size: 0.78rem;
}

.portal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    color: var(--portal-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.portal-back-link:hover { color: var(--portal-green); }

.portal-mobile-nav {
    position: fixed;
    right: 0.75rem;
    bottom: calc(0.65rem + env(safe-area-inset-bottom));
    left: 0.75rem;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(214, 224, 219, 0.95);
    border-radius: 1rem;
    box-shadow: 0 14px 40px rgba(23, 69, 54, 0.2);
    backdrop-filter: blur(14px);
}

.portal-mobile-nav a {
    display: grid;
    place-items: center;
    gap: 0.15rem;
    min-height: 50px;
    color: #78827e;
    border-radius: 0.75rem;
    font-size: 0.65rem;
    font-weight: 650;
}

.portal-mobile-nav i { font-size: 1.05rem; }

.portal-mobile-nav a.active {
    color: var(--portal-green-dark);
    background: var(--portal-green-soft);
}

.portal-login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.18), transparent 24rem),
        linear-gradient(145deg, #123a2f, #2e6e58 60%, #d8b66b 160%);
}

.portal-login-page::before {
    position: fixed;
    right: -8rem;
    bottom: -12rem;
    width: 32rem;
    height: 32rem;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 0 5rem rgba(255, 255, 255, 0.025), 0 0 0 10rem rgba(255, 255, 255, 0.018);
}

.portal-login-card {
    min-height: min(720px, calc(100vh - 3rem));
    border-radius: 1.25rem !important;
    box-shadow: 0 30px 75px rgba(4, 28, 20, 0.28);
}

.portal-login-title {
    margin-bottom: 0.65rem;
    font-size: 2rem;
    font-weight: 760;
}

/* Login and standalone pages */
.min-vh-100 { min-height: 100vh; }
.input-group .form-control { border-left: 0; }
.input-group .form-control:focus { border-left: 0; box-shadow: none; }
.input-group-text i { color: var(--portal-muted); }

/* Maps */
.custom-map-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 10px;
    padding: 8px;
    cursor: pointer;
    background: #fff;
    border: 0;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

#map_profile { width: 100%; height: 300px; margin-bottom: 1rem; }

@media (max-width: 991.98px) {
    body.portal-page { padding-bottom: 78px; }
    .portal-container { padding-top: 1.25rem; }
    .portal-brand-label { display: none; }
    .portal-payment-alert { align-items: flex-start; flex-wrap: wrap; }
    .portal-payment-alert .alert-link { margin-left: 1.9rem; }
    .card { border-radius: 0.9rem; }
}

@media (max-width: 1199.98px) {
    .project-detail-sticky { position: static; }
    .project-detail-layout > aside { max-width: 760px; }
    .quotation-sticky-panel { position: static; }
    .quotation-layout > aside { max-width: 760px; }
}

@media (max-width: 767.98px) {
    .project-detail-hero { grid-template-columns: 1fr; gap: 1.25rem; }
    .project-detail-hero-side { padding: 1rem 0 0; border-top: 1px solid rgba(255, 255, 255, 0.14); border-left: 0; }
    .project-file-grid { grid-template-columns: 1fr; }

    .project-hub-grid,
    .project-completed-grid { grid-template-columns: 1fr; }

    .quotation-library-grid { grid-template-columns: 1fr; }
    .quotation-library-toolbar { align-items: stretch; flex-direction: column; overflow: hidden; }
    .quotation-library-search { flex-basis: auto; max-width: none; width: 100%; }
    .quotation-library-filters {
        align-self: flex-start;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .quotation-library-filters::-webkit-scrollbar { display: none; }
    .quotation-library-order { display: none; }

    .quotation-hero {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .quotation-hero-total {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: baseline;
        min-width: 0;
        padding: 1rem 0 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-left: 0;
        text-align: left;
    }

    .quotation-hero-total > span { grid-column: 1 / -1; }
    .quotation-hero-total > small { margin-left: 0.35rem; }
    .quotation-hero-total .btn { grid-column: 1 / -1; }
    .quotation-detail-grid { grid-template-columns: 1fr; }
    .quotation-advisor { flex-wrap: wrap; }
    .quotation-advisor-actions { width: 100%; padding-left: 74px; }
}

@media (min-width: 992px) {
    .portal-container > .row {
        flex-wrap: nowrap;
        gap: 1.5rem;
    }

    .portal-container > .row > .col-lg-3 {
        flex: 0 0 260px;
        width: 260px;
    }

    .portal-container > .row > .col-lg-9 {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .portal-topbar { min-height: 62px; }
    .portal-topbar .navbar-brand img { height: 21px; }
    .portal-container {
        width: 100%;
        padding-right: 0.85rem;
        padding-left: 0.85rem;
    }
    .card-header, .card-body { padding: 1rem; }
    .col-lg-9 > .d-flex:first-child { align-items: flex-start !important; gap: 0.75rem; }
    .table > :not(caption) > * > * { padding: 0.75rem 0.6rem; }
    .portal-footer .container { text-align: center; }
    .portal-login-page { background: #fff; }
    .portal-login-page::before { display: none; }
    .portal-login-card { min-height: 100vh; border-radius: 0 !important; box-shadow: none; }

    .project-detail-back { margin-left: 0.15rem; }
    .project-detail-hero { margin-right: -0.15rem; margin-left: -0.15rem; padding: 1.25rem; border-radius: 1rem; }
    .project-detail-stage-icon { width: 46px; height: 46px; font-size: 1.05rem; }
    .project-detail-section-heading h2,
    .project-summary-card h2,
    .project-detail-warranty h2 { font-size: 1rem; }
    .project-stage-timeline li { grid-template-columns: 40px minmax(0, 1fr); gap: 0.65rem; }
    .project-stage-timeline::before { left: 19px; }
    .project-stage-marker { width: 40px; height: 40px; }
    .project-stage-timeline li > small { grid-column: 2; justify-self: start; }
    .project-note { max-width: 96%; }
    .project-note-avatar { width: 32px; height: 32px; }
    .project-note-avatar img { width: 32px; height: 32px; }
    .project-note-form-footer { align-items: stretch; flex-direction: column; }
    .project-note-form-footer .btn { justify-content: center; width: 100%; }

    .project-hub-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
    .project-hub-heading .btn { justify-content: center; width: 100%; }
    .project-hub-overview { gap: 0.6rem; }
    .project-hub-stat { min-height: 76px; padding: 0.8rem; }
    .project-hub-stat-icon { width: 38px; height: 38px; font-size: 0.95rem; }
    .project-hub-stat strong { font-size: 1.1rem; }
    .project-hub-stat small { font-size: 0.63rem; line-height: 1.2; }
    .project-hub-stat-arrow { display: none; }
    .project-hub-card { min-height: 380px; padding: 1rem; }
    .project-hub-dates { grid-template-columns: 1fr; }
    .project-hub-card-actions { align-items: stretch; flex-direction: column; }
    .project-hub-card-actions > * { width: 100%; }
    .project-hub-card-actions .btn { justify-content: space-between; }
    .project-hub-update-note,
    .project-hub-edit { padding: 0 0.15rem; }
    .project-completed-actions { grid-template-columns: 1fr; }

    .quotation-library-heading { align-items: flex-start; flex-direction: column; gap: 0.85rem; }
    .quotation-library-heading .quotation-library-total { align-self: flex-start; }
    .quotation-library-overview { gap: 0.6rem; }
    .quotation-library-stat { min-height: 74px; padding: 0.8rem; }
    .quotation-library-stat-icon { width: 36px; height: 36px; font-size: 0.95rem; }
    .quotation-library-stat strong { font-size: 1.05rem; }
    .quotation-library-stat div span { font-size: 0.65rem; line-height: 1.25; }
    .quotation-library-card { min-height: 250px; padding: 1rem; }
    .quotation-library-card-footer { align-items: stretch; flex-direction: column; }
    .quotation-library-open {
        justify-content: space-between;
        width: 100%;
        padding: 0.65rem 0.75rem;
        background: var(--portal-green-soft);
        border-radius: 0.65rem;
    }

    .quotation-back-link { margin-left: 0.15rem; }
    .quotation-hero { margin-right: -0.15rem; margin-left: -0.15rem; padding: 1.3rem; border-radius: 1rem; }
    .quotation-hero-main > p { font-size: 0.85rem; }
    .quotation-hero-meta { display: grid; gap: 0.5rem; }
    .quotation-summary-card .card-body,
    .quotation-response-card .card-body { padding: 1.1rem; }
    .quotation-section-heading h2,
    .quotation-summary-heading h2,
    .quotation-response-heading h2 { font-size: 1rem; }
    .quotation-advisor-actions { padding-left: 0; }
    .quotation-advisor-actions .btn { flex: 1; }
    .quotation-message { max-width: 94%; }
    .quotation-form-footer { align-items: stretch; flex-direction: column; }
    .quotation-form-footer .btn { width: 100%; }
    .quotation-confirm-actions { align-items: stretch; flex-direction: column-reverse; }
    .quotation-confirm-actions form,
    .quotation-confirm-actions .btn { width: 100%; }
}

@media print {
    body.portal-page { padding: 0; background: #fff; }
    .portal-topbar,
    .portal-sidebar,
    .portal-mobile-nav,
    .portal-footer,
    .portal-payment-alert,
    .quotation-back-link,
    .quotation-response-card,
    .quotation-advisor,
    #notes,
    .quotation-print-button,
    .quotation-hero-total .btn { display: none !important; }
    .portal-container { width: 100%; padding: 0; }
    .portal-container > .row > .col-lg-3 { display: none; }
    .portal-container > .row > .col-lg-9 { width: 100%; }
    .quotation-layout > .col-xl-8 { width: 66.666667%; }
    .quotation-layout > .col-xl-4 { width: 33.333333%; }
    .quotation-hero { color-adjust: exact; print-color-adjust: exact; box-shadow: none; }
    .quotation-sticky-panel { position: static; }
    .card { break-inside: avoid; box-shadow: none; }
}

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