:root {
    --bg: #f8f8f7;
    --panel: #ffffff;
    --text: #07090d;
    --muted: #6b7280;
    --line: #e7e7e7;
    --soft: #f1f2f4;
    --brand: #f6a11a;
    --brand-soft: #fff1dc;
    --green: #10b981;
    --red: #ef3340;
    --radius: 8px;
}

.permit-customer-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 25px 0 14px;
    color: var(--muted);
}

.permit-customer-summary span{
	font-size:12px;
}
.permit-customer-summary strong { color: var(--text); font-size: 18px; }
.permit-filter-form {
    margin-bottom: 18px;
    padding: 13px;
    border-color: #dfe6e1;
    border-radius: 18px;
    background: #fbfdfb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .035);
}
.permit-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(190px, 260px) auto auto;
    align-items: center;
    gap: 10px;
}
.permit-search-field {
    position: relative;
    display: block;
    min-width: 0;
}
.permit-search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #5e6c64;
    transform: translateY(-50%);
    pointer-events: none;
}
.permit-search-icon svg,
.permit-filter-button svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.permit-filter-form input[type="search"],
.permit-project-search .permit-search-field input[type="search"],
.permit-filter-form select {
    min-height: 46px;
    border-color: #e4e9e5;
    border-radius: 13px;
    background: #f4f7f4;
}
.permit-filter-form input[type="search"],
.permit-project-search .permit-search-field input[type="search"] { padding-left: 42px; }
.permit-filter-form input[type="search"]:focus,
.permit-project-search .permit-search-field input[type="search"]:focus,
.permit-filter-form select:focus {
    border-color: #8fc9a9;
    outline: 3px solid rgba(16, 137, 74, .1);
}
.permit-search-submit {
    min-height: 46px;
    border-radius: 13px;
    padding-inline: 20px;
}
.permit-status-filter-dropdown { position: relative; }
.permit-status-filter-dropdown > summary { list-style: none; }
.permit-status-filter-dropdown > summary::-webkit-details-marker { display: none; }
.permit-filter-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #dfe6e1;
    border-radius: 13px;
    color: #33443b;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}
.permit-filter-button svg { width: 17px; height: 17px; }
.permit-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    color: #08783e;
    background: #e3f0e9;
    font-size: 11px;
}
.permit-status-filter-dropdown[open] .permit-filter-button {
    border-color: #8fc9a9;
    color: #08783e;
}
.permit-status-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 25;
    display: grid;
    gap: 4px;
    width: min(390px, calc(100vw - 40px));
    max-height: min(430px, calc(100vh - 180px));
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #dfe6e1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .15);
}
.permit-status-filter-menu > strong {
    padding: 5px 8px 8px;
    color: #33443b;
    font-size: 13px;
}
.permit-status-filter-menu label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 8px;
    border-radius: 9px;
    color: #46534e;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
}
.permit-status-filter-menu label:hover { background: #f3f7f4; }
.permit-status-filter-menu input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px;
    min-height: 17px;
    margin: 1px 0 0;
    accent-color: #078344;
}
.permit-filter-clear {
    margin-top: 5px;
    padding: 10px 8px 4px;
    border-top: 1px solid var(--line);
    color: #08783e;
    font-size: 12px;
    font-weight: 800;
}
.permit-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
}
.permit-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 8px 5px 12px;
    border: 1px solid #a9d6bb;
    border-radius: 999px;
    color: #08783e;
    background: #e7f3ec;
    font-size: 12px;
    font-weight: 750;
}
.permit-filter-chip:hover { border-color: #69b68a; background: #dceee4; }
.permit-filter-chip-remove {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #245f40;
    background: rgba(255, 255, 255, .72);
    font-size: 16px;
    line-height: 1;
}
.table-card.permit-customer-table {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}
.permit-customer-table table { min-width: 1840px; }
.permit-customer-table th,
.permit-customer-table td { vertical-align: top; }
.permit-customer-table td:first-child { min-width: 190px; }
.permit-customer-table td:nth-child(2) { min-width: 250px; }
.permit-customer-table td:nth-child(3) { min-width: 132px; }
.permit-customer-table td:nth-child(5) { min-width: 220px; }
.permit-current-status { display: inline-flex; white-space: normal; line-height: 1.35; }
.permit-status-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 9px; }
.permit-status-button { display: block; margin-top: 9px; }
.permit-status-actions .permit-status-button,
.permit-status-actions .permit-status-disabled { margin-top: 0; }
.permit-questionnaire-button { white-space: nowrap; }
.permit-status-disabled {
    display: inline-block;
    margin-top: 9px;
    cursor: not-allowed;
}
.permit-status-disabled .permit-status-button {
    margin-top: 0;
    opacity: .52;
    cursor: not-allowed;
    pointer-events: none;
}
.permit-readonly,
.permit-finished { display: block; margin-top: 8px; color: var(--muted); font-weight: 700; }
.permit-finished { color: #16784a; }
.permit-history-button { color: #b96513; font-size: 20px; }
.permit-customer-documents {
    display: grid;
    grid-template-columns: repeat(4, 26px);
    gap: 7px;
    width: max-content;
}
.permit-customer-document-icon,
.permit-customer-document-missing {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
}
.permit-customer-document-icon {
    border: 1px solid #efb65f;
    color: #ad590d;
    background: var(--brand-soft);
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}
.permit-customer-document-icon:hover { transform: translateY(-1px); border-color: #d9861b; background: #ffe4b8; }
.permit-customer-document-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.permit-customer-document-missing { border: 1px dashed #d9dde3; background: #fafafa; }
.permit-customer-document-missing i { width: 13px; height: 2px; border-radius: 2px; background: #a5adb8; }
.permit-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 18px;
    font-weight: 800;
}
.permit-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 0;
    border-radius: 22px;
    padding: 26px;
    color: var(--text);
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}
.permit-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(3px); }
.permit-dialog form { display: grid; gap: 18px; }
.permit-dialog label { display: grid; gap: 8px; font-weight: 800; }
.permit-dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
}
.permit-dialog-head h2 { margin: 4px 0 0; }
.permit-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.permit-signature-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}
.permit-signature-choice legend { padding: 0 6px; font-weight: 900; }
.permit-signature-choice label { display: flex; align-items: center; gap: 8px; }
.permit-status-file small { display: block; color: var(--muted); font-weight: 600; }
.permit-timeline { list-style: none; margin: 20px 0 0; padding: 0; }
.permit-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    min-height: 64px;
    padding-bottom: 18px;
}
.permit-timeline li::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 17px;
    bottom: -1px;
    width: 2px;
    background: #d7dce3;
}
.permit-timeline li:last-child::after { display: none; }
.permit-timeline-dot {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 50%;
    background: #aab2bd;
    box-shadow: 0 0 0 4px #fff;
}
.permit-timeline li.complete .permit-timeline-dot,
.permit-timeline li.complete::after { background: #1c9b63; }
.permit-timeline li.current .permit-timeline-dot { background: #ef8d24; }
.permit-timeline li.current strong { color: #b65d09; }
.permit-timeline li.future { color: #8b95a3; }
.permit-timeline li div { display: grid; gap: 4px; }
.permit-timeline li small { color: inherit; }
.permit-event-details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.permit-event-details summary { cursor: pointer; font-weight: 900; }
.permit-event-details p { display: grid; gap: 3px; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line); }
.permit-event-details span { color: var(--muted); font-size: 13px; }
.permit-questionnaire-dialog { width: min(820px, calc(100vw - 32px)); }
.permit-questionnaire-sections { display: grid; gap: 16px; }
.permit-questionnaire-sections section { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.permit-questionnaire-sections h3 { margin: 0; padding: 13px 16px; background: #f7f8fa; font-size: 15px; }
.permit-questionnaire-sections dl { margin: 0; }
.permit-questionnaire-sections dl div { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(220px, 1.2fr); gap: 18px; padding: 11px 16px; border-top: 1px solid var(--line); }
.permit-questionnaire-sections dt { color: var(--muted); font-size: 13px; font-weight: 800; }
.permit-questionnaire-sections dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 980px) {
    .permit-filter-toolbar { grid-template-columns: 1fr 1fr; }
    .permit-search-field,
    .permit-search-column-field { grid-column: 1 / -1; }
    .permit-search-submit,
    .permit-filter-button { width: 100%; }
    .permit-customer-summary { align-items: flex-start; flex-direction: column; }
    .permit-dialog { padding: 20px; border-radius: 18px; }
    .permit-dialog-actions { display: grid; grid-template-columns: 1fr; }
    .permit-dialog-actions .button { width: 100%; }
    .permit-pagination { flex-wrap: wrap; }
    .permit-questionnaire-sections dl div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
    .permit-filter-toolbar { grid-template-columns: 1fr; }
    .permit-search-field,
    .permit-search-column-field { grid-column: auto; }
    .permit-status-filter-menu {
        right: auto;
        left: 0;
        width: min(390px, calc(100vw - 54px));
    }
}

.admin-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: end;
    gap: 14px;
	padding: 22px 22px 30px 22px !important;
    margin: 0 0 20px !important;
    min-width: 0 !important;
}
.admin-customer-header { align-items: center; }
.admin-project-grid { margin-bottom: 24px; }
.admin-project-create-card {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
    gap: 24px;
    margin-bottom: 24px;
}
.admin-project-create-card h2 { margin: 4px 0 8px; }
.admin-project-create-card p { margin: 0; color: var(--muted); }
.admin-project-create-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.admin-project-create-form label:first-of-type,
.admin-project-create-form label:nth-of-type(2),
.admin-project-create-actions { grid-column: 1 / -1; }
.admin-project-create-actions { display: flex; justify-content: flex-end; }
.admin-project-context {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.admin-project-context select { min-width: min(100%, 380px); }
.admin-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.admin-data-list { margin: 0; }
.admin-data-list > div {
    display: grid;
    grid-template-columns: minmax(180px, 35%) 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.admin-data-list dt { font-weight: 800; }
.admin-data-list dd { margin: 0; }
.admin-missing-documents { margin-top: 18px; }
.admin-missing-documents ul {
    display: grid;
    gap: 0;
    margin: 16px 0 20px;
    padding: 0;
    list-style: none;
}
.admin-missing-documents li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
    .admin-filter-form { grid-template-columns: 1fr; }
    .admin-project-context { align-items: stretch; flex-direction: column; }
    .admin-project-context select { width: 100%; min-width: 0; }
    .admin-detail-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
    .admin-detail-tabs .button { flex: 0 0 auto; }
    .admin-data-list > div { grid-template-columns: 1fr; gap: 4px; }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    border-right: 1px solid var(--line);
    background: #fbfbfa;
    display: flex;
    flex-direction: column;
}

.brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    font-weight: 800;
    font-size: 14px;
}

.brand img {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
}

.nav-group { padding: 18px 10px 4px; }
.nav-label {
    display: block;
    margin: 0 0 8px 4px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.nav-item {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: #111827;
    font-size: 14px;
}

.nav-item.active { background: #edeff1; }
.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d3d5d8;
    flex: 0 0 auto;
}
.nav-item.active .nav-dot { background: var(--brand); }

.role-permitting-partner .nav-item,
.role-installer-partner .nav-item,
.role-customer .nav-item {
    min-height: 40px;
    gap: 13px;
    padding: 0 13px;
    border-radius: 10px;
    color: #46534e;
    font-size: 15px;
}
.role-permitting-partner .nav-item + .nav-item,
.role-installer-partner .nav-item + .nav-item,
.role-customer .nav-item + .nav-item {
    margin-top: 2px;
}
.role-permitting-partner .nav-item.active,
.role-installer-partner .nav-item.active,
.role-customer .nav-item.active {
    color: #008744;
    background: #e3f0e9;
    font-weight: 650;
}
.nav-icon {
    display: inline-flex;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}
.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-user {
    margin: auto 15px 15px 15px;
    background-color: #F7FAF6;
    min-height: 64px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e5e7eb;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.avatar-initials {
    color: #fcfcfc;
    background: #0A7E3A;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
}

.avatar-image {
    background-size: cover;
    background-position: center;
}

.sidebar-user strong, .sidebar-user small {
    display: block;
    font-size: 13px;
}
.sidebar-user small { 
	color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 75%;
}

.app {
    margin-left: 248px;
    min-height: 100vh;
    padding-top: 64px;
    background-color: #EBEEF7;
}

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 248px;
    z-index: 25;
    height: 64px;
    border-bottom: 1px solid var(--line);
    background: #fbfbfa;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.icon-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #111827;
    cursor: pointer;
}

.mobile-menu-panel {
    display: none;
}

.system-status {
	display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .08em;
    background-color: #E6F2EB;
    padding: 5px 12px;
    border: 1px solid oklch(92% .01 140);
    border-radius: 3.40282e38px;
}
.system-status span {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
}

.topbar-status-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: #46534e;
}

.notification-bell:hover,
.notification-bell:focus-visible {
    border-color: #9fb4a7;
    color: #008744;
    outline: none;
}

.notification-bell svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fbfbfa;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.current-project {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 12px;
    margin: 0 auto 0 20px;
}

.current-project > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.current-project strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.current-project a {
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.current-project a:hover,
.current-project a:focus-visible {
    text-decoration: underline;
}

.archived-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 22px;
    padding: 2px 8px;
    border: 1px solid #c9bda7;
    border-radius: 999px;
    background: #f3eee5;
    color: #665b49;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.archived-project-banner {
    display: grid;
    gap: 4px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid #c9bda7;
    border-left: 4px solid #8b7c63;
    border-radius: var(--radius);
    background: #f7f3ec;
    color: #443d32;
}

.archived-project-banner span,
.readonly-action-note,
.archived-project-card small {
    color: var(--muted);
    font-size: 13px;
}

.content {
    width: min(1120px, calc(100vw - 300px));
    margin: 0 auto;
    padding: 44px 0 80px;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.eyebrow {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

h1, h2, p { margin-top: 0; }
h1 {
    margin-bottom: 8px;
    font-size: 32px;
    line-height: 1.05;
    font-weight: 700;
}
.page-header p, .phase-card p, .upload-card p { color: var(--muted); margin-bottom: 0; }
h2 { font-size: 20px; line-height: 1.2; margin-bottom: 6px; }

.project-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.project-selector-card,
.project-empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 24px;
}

.project-selector-card {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.project-selector-card p,
.project-empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

.project-selector-card form {
    flex: 0 0 auto;
}

.project-empty-state {
    max-width: 680px;
}

.project-list-title {
    margin: 28px 0 14px;
}

.archived-list-title {
    margin-top: 36px;
}

.archived-project-card {
    border-color: #d8d0c2;
    background: #fbf9f5;
}

.archived-project-card small {
    display: block;
    margin-top: 8px;
    font-weight: 700;
}

.readonly-action-note {
    display: inline-block;
    margin: 0;
    font-weight: 700;
}

.readonly-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.readonly-fieldset:disabled,
.questionnaire fieldset:disabled {
    opacity: .82;
}

.button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.button.dark { border-color: #15171c; background: #15171c; color: #fff; }
.button.ghost { background: #fff; }
.button.danger { border-color: #fecdd3; background: #fff1f2; color: #be123c; }

.phase-card, .metric, .todo-item, .info-card, .table-card, .form-card, .upload-card, .message-list, .timeline {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 16px;
}

.phase-card { padding: 28px; margin-bottom: 28px; }
.phase-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.progress-badge {
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}
.progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 28px 0 10px;
}
.progress span {
    display: block;
    height: 100%;
    background: var(--brand);
}
.phase-labels {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.metric { padding: 18px; min-height: 80px; }
.metric span {
    display: block;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
    line-height: 1.2;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 24px;
}
.section-title {
    margin: 0 0 14px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.todo-list { display: grid; gap: 10px; }
.todo-item {
    min-height: 70px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 12px;
}
.todo-item small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}
.state-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}
.state-dot.missing { background: var(--red); }
.state-dot.review { background: var(--brand); }
.state-dot.accepted { background: var(--green); }

.overview-checklist {
    display: grid;
    gap: 12px;
}

.overview-check {
    min-height: 86px;
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 16px;
    background: var(--panel);
}

.overview-check.success {
    border-left-color: var(--green);
}

.overview-check.warning {
    border-left-color: var(--brand);
}

.overview-check.neutral {
    border-left-color: #cbd5e1;
}

.overview-check strong {
    display: block;
    margin-bottom: 4px;
}

.overview-check p {
    margin: 0;
    color: #374151;
}

.system-summary {
    display: grid;
    gap: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    overflow: hidden;
}

.system-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    background: #fbfbfa;
    border-bottom: 1px solid var(--line);
}

.system-hero h2 {
    margin: 8px 0;
    font-size: 28px;
}

.system-hero p {
    margin: 0;
    color: var(--muted);
}

.system-capacity {
    min-width: 132px;
    min-height: 94px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--brand-soft);
    color: #111827;
}

.system-capacity strong {
    display: block;
    color: var(--brand);
    font-size: 34px;
    line-height: .9;
}

.system-capacity span {
    color: #374151;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.system-section {
    padding: 0 28px 24px;
}

.system-section h3 {
    margin: 0 0 14px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
}

.system-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.system-facts div,
.warranty-grid div {
    min-height: 74px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.system-facts span,
.warranty-grid span,
.system-option-list span {
    display: block;
    margin-bottom: 7px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.system-facts strong,
.warranty-grid strong,
.system-option-list strong {
    display: block;
    color: #111827;
    font-size: 15px;
    line-height: 1.35;
}

.system-map-card {
    display: grid;
    grid-template-columns: minmax(240px, .45fr) minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.system-map-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

.system-map-copy h3 {
    margin-bottom: 8px;
}

.system-map-copy p {
    margin: 0 0 16px;
    color: #374151;
    line-height: 1.45;
}

.system-map {
    min-height: 320px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #e5e7eb;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.system-map .leaflet-control-attribution {
    font-size: 10px;
}

.system-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 22px;
}

.system-grid .system-section {
    min-width: 0;
}

.system-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.system-tags span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
}

.system-option-list {
    display: grid;
    gap: 10px;
}

.system-option-list p {
    min-height: 58px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.warranty-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.system-page {
    display: grid;
    gap: 34px;
}

.system-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.system-page-head h1 {
    margin-bottom: 8px;
    font-size: 34px;
    line-height: 1.05;
}

.system-page-head p {
    margin: 0;
    color: var(--muted);
}

.system-location-card {
    min-height: 132px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: 26px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.system-location-card span,
.system-tech-grid span,
.system-property-copy span,
.system-warranty-strip span {
    display: block;
    margin-bottom: 8px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.system-location-card strong {
    display: block;
    color: #05070b;
    font-size: 20px;
    line-height: 1.25;
}

.system-location-card p {
    margin: 10px 0 0;
    color: var(--muted);
}

.system-location-power {
    min-width: 210px;
    display: grid;
    grid-template-columns: 8px 1fr;
    align-items: center;
    column-gap: 18px;
    justify-items: end;
}

.system-location-power i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.system-location-power strong {
    font-size: 30px;
    font-weight: 500;
}

.system-location-power small {
    color: #9ca3af;
    font-size: 20px;
    font-weight: 600;
}

.system-location-power span {
    grid-column: 2;
    margin: 0;
}

.system-block {
    display: grid;
    gap: 16px;
}

.system-tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.system-tech-grid div {
    min-height: 88px;
    padding: 24px 28px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.system-tech-grid div:nth-child(2n) {
    border-right: 0;
}

.system-tech-grid div:nth-last-child(-n+2) {
    border-bottom: 0;
}

.system-tech-grid strong,
.system-property-copy strong {
    display: block;
    color: #05070b;
    font-size: 16px;
    line-height: 1.35;
}

.system-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .95fr);
    gap: 18px;
}

.system-pill-card,
.system-options-card,
.system-warranty-strip,
.system-property-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.system-pill-card {
    min-height: 164px;
    display: flex;
    align-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px;
}

.system-pill-card span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfbfa;
    color: #111827;
    font-size: 14px;
}

.system-options-card {
    padding: 12px 22px;
}

.system-options-card p {
    min-height: 50px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
}

.system-options-card p:last-child {
    border-bottom: 0;
}

.option-badge {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
}

.option-badge.success {
    background: #dff8ee;
    color: #059669;
}

.option-badge.warning {
    background: #fff2dc;
    color: #f59e0b;
}

.option-badge.muted {
    background: #f4f4f5;
    color: #64748b;
}

.system-warranty-strip {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
}

.system-warranty-strip div {
    min-height: 104px;
    padding: 20px 22px;
    border-right: 1px solid var(--line);
}

.system-warranty-strip div:last-child {
    border-right: 0;
}

.system-warranty-strip strong {
    font-size: 24px;
    line-height: 1.1;
}

.system-property-card {
    min-height: 156px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 18px;
    align-items: stretch;
    padding: 26px;
}

.system-property-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

.system-property-copy p {
    margin: 8px 0 16px;
    color: var(--muted);
}

.system-property-map {
    min-height: 180px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #e5e7eb;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.system-property-map .leaflet-control-attribution {
    font-size: 10px;
}

.info-card { padding: 18px; }
dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0;
}
dt {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
dd { margin: 0; font-weight: 700; }

.notice {
    margin: -12px 0 22px;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
}
.notice.success { background: #e8f8f1; color: #047857; }
.notice.neutral { background: #eef2ff; color: #334155; }
.notice.danger { background: #fff1f2; color: #be123c; }

.questionnaire { display: grid; gap: 18px; }
.questionnaire-page-header,
.questionnaire-modern {
    width: min(100%, 980px);
}
.questionnaire-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 34px;
}
.questionnaire-page-header h1 {
    margin: 10px 0 12px;
    font-size: 40px;
    letter-spacing: -.035em;
}
.questionnaire-page-header p {
    max-width: 620px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}
.questionnaire-page-header .eyebrow {
    color: #00843d;
}
.questionnaire-edit-note {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding-bottom: 4px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.35;
}
.questionnaire-edit-note svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #00843d;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.questionnaire-modern {
    gap: 22px;
}
.questionnaire-modern .questionnaire-step {
    overflow: hidden;
    padding: 0;
    border-color: #cfd8e3;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 30px rgba(15, 23, 42, .035);
}
.questionnaire-modern .questionnaire-step:disabled {
    opacity: 1;
}
.questionnaire-step-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 18px 28px;
    border-bottom: 1px solid #d7dee8;
    background: #f8fafc;
}
.questionnaire-step-icon,
.questionnaire-submit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #c9f4d7;
    color: #00843d;
}
.questionnaire-step-icon svg,
.questionnaire-submit-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.questionnaire-step-title {
    min-width: 0;
}
.questionnaire-step-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    color: #00843d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.questionnaire-step-kicker i {
    display: block;
    width: 24px;
    height: 1px;
    background: #cbd5e1;
}
.questionnaire-step-title h2 {
    margin-bottom: 5px;
    font-size: 18px;
}
.questionnaire-step-title p {
    margin-bottom: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}
.questionnaire-step-body {
    gap: 20px 22px;
    padding: 28px;
}
.questionnaire-modern .form-field > span {
    margin-bottom: 9px;
    color: #475569;
    font-size: 11px;
    letter-spacing: .02em;
}
.questionnaire-modern input,
.questionnaire-modern select {
    min-height: 49px;
    border-color: #cbd5e1;
    border-radius: 8px;
    padding: 0 16px;
    color: #0f172a;
    font-size: 16px;
}
.questionnaire-modern input::placeholder {
    color: #718096;
    opacity: 1;
}
.questionnaire-modern input:focus,
.questionnaire-modern select:focus {
    border-color: #58ad7d;
    outline: 3px solid rgba(0, 132, 61, .1);
}
.questionnaire-modern .questionnaire-step:disabled input,
.questionnaire-modern .questionnaire-step:disabled select {
    background: #f8fafc;
    color: #475569;
}
.questionnaire-modern .field-mailing_address {
    grid-column: 1 / -1;
}
.questionnaire-submit-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    border: 1px solid #abd8bd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.questionnaire-submit-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
}
.questionnaire-submit-icon svg {
    width: 20px;
    height: 20px;
}
.questionnaire-submit-card h2 {
    margin-bottom: 4px;
    font-size: 16px;
}
.questionnaire-submit-card p {
    max-width: 540px;
    margin-bottom: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}
.questionnaire-save-button {
    min-height: 48px;
    gap: 10px;
    border-color: #00843d;
    border-radius: 8px;
    padding: 0 24px;
    background: #00843d;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 10px 22px rgba(0, 132, 61, .18);
}
.questionnaire-save-button:hover {
    border-color: #006f34;
    background: #006f34;
}
.questionnaire-save-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.questionnaire-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 2px 0 0;
    color: #64748b;
    font-size: 12px;
}
.questionnaire-help span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin: 0;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: inherit;
    font-size: 10px;
    font-weight: 800;
}
.form-card {
    padding: 22px;
    margin: 0;
    min-width: 0;
}
.form-card legend {
    padding: 0 8px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.quotation-admin-form {
    display: grid;
    gap: 24px;
}
.quotation-admin-form fieldset {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.quotation-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.quotation-form-grid .wide {
    grid-column: 1 / -1;
}
.quotation-admin-form textarea {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 12px;
    color: #111827;
    font: inherit;
}
.quotation-settings-form {
    max-width: 980px;
	margin-bottom: 30px;
}
.settings-textarea {
    display: grid;
    gap: 8px;
}
.settings-textarea + .settings-textarea {
    margin-top: 18px;
}
.quotation-settings-form code {
    padding: 2px 5px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #334155;
    font-size: .92em;
}
.quotation-settings-form .quotation-form-note {
    margin: 12px 0 0;
    line-height: 1.45;
}

.contract-editor-label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 700;
}

.contract-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.55rem;
    border: 1px solid #d9dee5;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #f5f7f9;
}

.contract-editor-toolbar button {
    min-width: 2.25rem;
    min-height: 2.1rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #cbd2da;
    border-radius: 6px;
    background: #fff;
    color: #16202a;
    cursor: pointer;
}

.contract-editor-toolbar button:hover,
.contract-editor-toolbar button:focus-visible {
    border-color: #d8a321;
    outline: 2px solid rgba(216, 163, 33, 0.2);
}

.contract-richtext-editor {
    min-height: 24rem;
    max-height: 45rem;
    overflow: auto;
    padding: 1rem;
    border: 1px solid #d9dee5;
    border-radius: 0 0 10px 10px;
    background: #fff;
    line-height: 1.55;
}

.contract-richtext-editor:focus {
    border-color: #d8a321;
    outline: 3px solid rgba(216, 163, 33, 0.15);
}

.contract-richtext-source {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.contract-template-preview {
    margin-top: 0.75rem;
    padding: 1rem;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    background: #fff;
    line-height: 1.55;
}

.contract-richtext-editor .contract-align-left,
.contract-template-preview .contract-align-left {
    text-align: left;
}

.contract-richtext-editor .contract-align-center,
.contract-template-preview .contract-align-center {
    text-align: center;
}

.contract-richtext-editor .contract-align-right,
.contract-template-preview .contract-align-right {
    text-align: right;
}
.quotation-admin-form input[readonly] {
    background: #f8fafc;
    color: #64748b;
}
.quotation-total {
    margin: 18px 0 0;
    text-align: right;
    font-size: 17px;
}
.quotation-items-head,
.quotation-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.quotation-items-head legend {
    float: left;
}
.quotation-items {
    display: grid;
    clear: both;
    gap: 12px;
    margin-top: 16px;
}
.quotation-item-row {
    display: grid;
    grid-template-columns: 38px minmax(260px, 1fr) 100px 130px auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
#editable-quotation-items {
    display: grid;
    gap: 16px;
}
#editable-quotation-form .quotation-item-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
#editable-quotation-form .quotation-item-row > label {
    grid-column: auto;
    min-width: 0;
}
#editable-quotation-form .quotation-item-row > .button-row {
    grid-column: 1 / -1;
}
#editable-quotation-form fieldset[disabled] {
    opacity: .8;
}
.quotation-price-mobile-label {
    display: none;
}
@media (max-width: 980px) {
    #editable-quotation-form .quotation-item-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .quotation-price-mobile-label {
        display: inline;
        font-weight: 600;
    }
}
.quotation-item-drag-handle {
    align-self: stretch;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    cursor: grab;
    touch-action: none;
    user-select: none;
    font: inherit;
    font-size: 22px;
    line-height: 1;
}
.quotation-item-drag-handle:hover,
.quotation-item-drag-handle:focus-visible {
    border-color: #94a3b8;
    color: #111827;
    outline: 2px solid rgba(16, 185, 129, .24);
    outline-offset: 1px;
}
.quotation-item-drag-handle:active {
    cursor: grabbing;
}
.quotation-item-drag-handle:disabled {
    cursor: default;
    opacity: .38;
}
.quotation-item-row.dragging {
    opacity: .7;
    border-color: var(--green);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.quotation-item-row.drag-target-before {
    box-shadow: inset 0 3px 0 var(--green);
}
.quotation-item-row.drag-target-after {
    box-shadow: inset 0 -3px 0 var(--green);
}
.quotation-items.is-reordering {
    cursor: grabbing;
}
.quotation-remove-item:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.quotation-form-note {
    margin: -8px 0 0;
    color: #64748b;
    font-size: 13px;
}
.quotation-version-section,
.quotation-customer-versions {
    margin-top: 28px;
}
.quotation-version-loaded {
    clear: both;
    margin: 16px 0 0;
}
.quotation-version-row {
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}
.quotation-version-row:hover,
.quotation-version-row:focus-visible {
    background: #f7fafc;
    outline: none;
    box-shadow: inset 3px 0 0 #94a3b8;
}
.quotation-version-row.selected {
    background: #eef7f0;
    box-shadow: inset 4px 0 0 var(--green);
}
.quotation-version-select-link {
    color: inherit;
    text-decoration: none;
}
.quotation-viewer-toolbar {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.quotation-viewer-toolbar > div {
    display: flex;
    align-items: center;
    gap: 10px;
}
.quotation-viewer-toolbar span {
    color: #64748b;
    font-size: 13px;
}
.quotation-pdf-frame-wrap {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #e5e7eb;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .09);
}
.quotation-pdf-frame {
    display: block;
    width: 100%;
    height: min(1120px, calc(100vh - 210px));
    min-height: 680px;
    border: 0;
}
.quotation-empty-state {
    max-width: 720px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field-day_meter_serial,
.field-controlled_meter_serial {
    grid-column: 1;
}

label span {
    display: block;
    margin-bottom: 7px;
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
input:not([type="checkbox"]):not([type="radio"]), select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 0 12px;
    color: #111827;
}
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
}
.sticky-actions p { margin: 0; color: var(--muted); }

.table-card { overflow: hidden; }
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
th, td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
th {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.status { font-weight: 700; font-size: 13px; }
.status.success { color: #059669; }
.status.neutral { color: #64748b; }
.status.danger { color: var(--red); }
.status.warning { color: #f97316; }
.status.muted { color: #9ca3af; }

.invoice-status-cell {
    display: grid;
    gap: 10px;
    min-width: 260px;
}

.invoice-table-card {
    overflow-x: auto;
}

.invoice-table-card table {
    min-width: 720px;
}

.invoice-add-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, .5fr) minmax(240px, 1.2fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 18px;
}

.invoice-add-form label {
    display: grid;
    gap: 7px;
}

.invoice-add-form label > span {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
}

.invoice-add-form small {
    color: var(--muted);
}

.invoice-file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-file-icon {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #15171c;
    cursor: pointer;
}

.invoice-file-icon:hover {
    border-color: #15171c;
}

.invoice-file-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.invoice-file-icon input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.invoice-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    font-size: 13px;
    font-weight: 800;
}

.invoice-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
    background: #94a3b8;
}

.invoice-status-indicator.paid { color: #059669; }
.invoice-status-indicator.paid .invoice-status-dot { background: #10b981; }
.invoice-status-indicator.unpaid { color: #dc2626; }
.invoice-status-indicator.unpaid .invoice-status-dot {
    background: #dc2626;
    animation: invoice-status-pulse 1.5s ease-in-out infinite;
}

.invoice-status-indicator.unknown { color: #64748b; }

.invoice-status-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invoice-status-form select {
    min-width: 125px;
}

.invoice-status-form .button {
    min-height: 38px;
    padding: 0 12px;
}

@keyframes invoice-status-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); transform: scale(1); }
    50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    .invoice-status-indicator.unpaid .invoice-status-dot {
        animation: none;
    }
}

@media (max-width: 980px) {
    .admin-project-create-card,
    .admin-project-create-form { grid-template-columns: 1fr; }
    .admin-project-create-form label:first-of-type,
    .admin-project-create-form label:nth-of-type(2),
    .admin-project-create-actions { grid-column: auto; }
    .admin-project-create-actions .button { width: 100%; }
    .invoice-add-form {
        grid-template-columns: 1fr;
    }
}

.empty-value {
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.upload-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.file-button {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    background: #fff;
    white-space: nowrap;
}
.file-button input {
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
}
.file-button span {
    margin: 0;
    color: #111827;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.upload-card { padding: 22px; }
.upload-card .upload-inline {
    margin-top: 18px;
    justify-content: flex-start;
}

.timeline {
    padding: 24px;
    display: grid;
    gap: 0;
}
.timeline article {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 16px;
    min-height: 72px;
    position: relative;
}
.timeline article::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 18px;
    bottom: -18px;
    width: 1px;
    background: var(--line);
}
.timeline article:last-child::after { display: none; }
.timeline article > span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e5e7eb;
    margin-top: 2px;
    z-index: 1;
}
.timeline article.current > span { background: var(--brand); }
.timeline article.complete > span { background: #16835a; }
.timeline strong, .timeline small { display: block; }
.timeline small { margin-top: 4px; color: var(--muted); }

.message-composer {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.composer-row {
    display: grid;
    grid-template-columns: minmax(220px, 320px);
}

.composer-editor {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.composer-toolbar {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-bottom: 1px solid var(--line);
    background: #fbfbfa;
}

.composer-toolbar button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font-size: 14px;
}

.composer-toolbar button:hover,
.composer-toolbar button:focus-visible {
    border-color: var(--line);
    background: #fff;
}

.composer-body {
    min-height: 132px;
    padding: 14px;
    color: #111827;
    line-height: 1.5;
    outline: none;
}

.composer-body:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}

.composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.message-list article {
    display: grid;
    grid-template-columns: 36px 1fr auto 8px;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}
.message-list article:last-child { border-bottom: 0; }
.message-list strong { display: block; }
.message-list em { color: #9ca3af; font-style: normal; font-weight: 500; }
.message-list p { margin: 4px 0 0; color: #374151; }
.message-list time { color: var(--muted); font-size: 12px; }
.unread {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
}

.mailbox-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.mailbox-compose-link {
    margin-left: auto;
}

.internal-message-composer {
    display: grid;
    gap: 16px;
    max-width: 820px;
    padding: 22px;
}

.internal-message-composer label {
    display: grid;
}

.internal-message-composer textarea {
    width: 100%;
    min-height: 190px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 13px;
    color: #111827;
    font: inherit;
    line-height: 1.55;
}

.internal-message-composer input:focus,
.internal-message-composer select:focus,
.internal-message-composer textarea:focus {
    border-color: #7daf92;
    outline: 3px solid rgba(0, 135, 68, .11);
}

.mail-recipient-summary {
    display: grid;
    gap: 3px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7f9f7;
}

.mail-recipient-summary > span {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.mail-recipient-summary small {
    color: var(--muted);
}

.mail-composer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.mailbox-list,
.mail-detail,
.legacy-message-history {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.mailbox-row {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.mailbox-row:last-child {
    border-bottom: 0;
}

.mailbox-row:hover {
    background: #f7faf8;
}

.mailbox-row.is-unread {
    border-left: 4px solid #008744;
    padding-left: 14px;
    background: #f0f8f4;
}

.mail-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e3f0e9;
    color: #008744;
    font-weight: 800;
    text-transform: uppercase;
}

.mailbox-row-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.mailbox-row-main strong,
.mailbox-row-main span,
.mailbox-row-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mailbox-row-main span {
    color: #374151;
}

.mailbox-row-main small,
.mailbox-row-meta {
    color: var(--muted);
    font-size: 12px;
}

.mailbox-row-meta {
    display: grid;
    justify-items: end;
    gap: 7px;
}

.mail-open-form,
.mail-row-link {
    position: absolute;
    inset: 0;
}

.mail-open-form button {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mailbox-empty {
    padding: 34px 22px;
    color: var(--muted);
    text-align: center;
}

.mail-read-receipt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.mail-read-receipt::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.mail-read-receipt.read {
    color: #008744;
}

.mail-read-receipt.read::before {
    background: #16a34a;
}

.mail-detail {
    padding: 24px;
}

.mail-detail header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.mail-detail h2 {
    margin: 10px 0 8px;
    font-size: 25px;
}

.mail-detail header p,
.mail-detail header small,
.mail-detail time {
    color: var(--muted);
}

.mail-detail header p {
    margin-bottom: 4px;
}

.mail-direction {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mail-direction.incoming {
    background: #e3f0e9;
    color: #008744;
}

.mail-direction.outgoing {
    background: #eef2f7;
    color: #475569;
}

.mail-detail-body {
    min-height: 160px;
    padding: 24px 0;
    color: #1f2937;
    line-height: 1.65;
}

.mail-detail footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.legacy-message-history {
    margin-top: 22px;
}

.legacy-message-history summary {
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 700;
}

.legacy-message-compose {
    margin-top: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.legacy-message-compose summary {
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 700;
}

.legacy-message-compose form {
    display: grid;
    gap: 14px;
    padding: 0 18px 18px;
}

.legacy-message-compose textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    font: inherit;
}

.legacy-message-compose .button {
    justify-self: end;
}

.rows { padding: 0 18px; }
.rows p {
    min-height: 48px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
}
.rows p:last-child { border-bottom: 0; }
.rows span {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.settings-list { display: grid; gap: 18px; }

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

.settings-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.settings-profile {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.avatar-upload {
    display: grid;
    justify-items: start;
    gap: 14px;
}

.settings-avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e5e7eb;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
}

.settings-avatar.avatar-initials {
    color: #0f2f57;
    font-size: 34px;
}

.avatar-upload .button {
    position: relative;
    overflow: hidden;
}

.avatar-upload .button span {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-transform: none;
    letter-spacing: 0;
}

.avatar-upload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    cursor: pointer;
}

.settings-toggles {
    display: grid;
    gap: 14px;
}

.login-body {
    min-height: 100vh;
    background: #fff;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr);
}

.login-hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 56px 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 24% 100%, rgba(16, 185, 129, .28), transparent 36%),
        radial-gradient(circle at 82% 8%, rgba(246, 161, 26, .32), transparent 34%),
        #07080b;
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to right, #000, rgba(0,0,0,.72));
}

.login-brand, .login-copy, .login-footer {
    position: relative;
    z-index: 1;
}

.login-brand {
    width: 265px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.94);
}

.login-brand img {
    display: block;
    width: 100%;
    height: auto;
}

.login-copy {
    max-width: 650px;
}

.login-version {
    display: block;
    margin-bottom: 34px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .28em;
}

.login-copy h1 {
    margin-bottom: 34px;
    font-size: 56px;
    line-height: .98;
    font-weight: 750;
}

.login-copy h1 strong {
    display: inline-block;
    color: var(--brand);
}

.login-copy p {
    max-width: 620px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.6;
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 690px;
    margin-top: 42px;
    border-top: 1px solid rgba(255,255,255,.12);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.login-stats span {
    padding: 22px 0;
}

.login-stats strong, .login-stats small {
    display: block;
}

.login-stats strong {
    font-size: 24px;
}

.login-stats small {
    margin-top: 7px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.login-footer span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.login-panel {
    min-height: 100vh;
    padding: 28px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #fff;
}

.login-topline {
    position: absolute;
    top: 28px;
    right: 34px;
    color: var(--muted);
    font-size: 13px;
}

.login-topline a, .login-help a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-form {
    width: min(480px, 100%);
}

.login-form h2 {
    margin: 10px 0 10px;
    font-size: 34px;
}

.login-form > p {
    margin-bottom: 34px;
    color: var(--muted);
    font-size: 16px;
}

.login-form label {
    display: block;
    margin-bottom: 20px;
}

.checkbox-line {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
}

.checkbox-line span {
    margin: 0;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.login-submit {
    width: 100%;
    min-height: 52px;
    font-size: 15px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 34px 0;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.google-button {
    width: 100%;
    min-height: 50px;
    gap: 12px;
    font-size: 15px;
}

.google-button span {
    color: #4285f4;
    font-weight: 900;
}

.login-help {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 38px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.admin-split {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

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

.inline-action {
    display: inline-flex;
    justify-content: flex-end;
}

.library-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.contract-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.contract-upload {
    display: inline-flex;
}

.contract-file-button {
    position: relative;
    overflow: hidden;
}

.contract-file-button span {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-transform: none;
    letter-spacing: 0;
}

.contract-file-button input {
    position: absolute;
    inset: 0;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    cursor: pointer;
}

.installer-focus {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 440px;
}

.installer-metrics {
    grid-template-columns: repeat(4, 1fr);
}

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

.installer-empty-state,
.installer-next,
.installer-document-project {
    margin-top: 18px;
}

.installer-job-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    padding: 22px;
}

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

.job-card-head h2 {
    margin: 6px 0;
}

.job-card-head p,
.installer-note p,
.installer-next p,
.muted-copy {
    color: var(--muted);
}

.job-card-head > strong {
    color: #9ca3af;
    font-size: 12px;
    white-space: nowrap;
}

.job-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.job-facts div {
    min-width: 0;
}

.installer-note {
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius);
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.installer-note strong {
    display: block;
    margin-bottom: 4px;
}

.installer-note p {
    margin: 0;
}

.job-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.doc-alert {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: var(--radius);
    background: #fff7ed;
    color: #c2410c;
    font-size: 12px;
    font-weight: 800;
}

.compact {
    margin-top: 14px;
}

.compact p {
    min-height: 42px;
}

.installer-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.permit-document-upload {
    max-width: 980px;
    gap: 22px;
}

.permit-upload-head,
.permit-upload-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.permit-upload-head h2 {
    margin-top: 5px;
    margin-bottom: 0;
    font-size: 22px;
    font-weight: 900;
}

.permit-upload-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.permit-upload-file {
    min-height: 150px;
    border-width: 2px;
    background: #fffdf9;
}

.permit-upload-file span {
    font-size: 16px;
    font-weight: 900;
}

.permit-upload-file small {
    color: var(--muted);
    font-weight: 600;
}

.permit-upload-actions {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.permit-upload-actions p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.permit-project-finder {
    display: grid;
    gap: 20px;
    max-width: 980px;
}

.permit-project-search {
    display: grid;
    gap: 8px;
}

.permit-project-search-label {
    color: #667085;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.permit-project-search > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.permit-project-search input {
    width: 100%;
}

.permit-project-results {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.permit-project-result {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.2fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 72px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.permit-project-result:hover {
    border-color: #f0a04b;
    box-shadow: 0 8px 22px rgba(27, 31, 36, .08);
    transform: translateY(-1px);
}

.permit-project-result span:first-child {
    display: grid;
    gap: 4px;
}

.permit-project-result small,
.permit-project-result span:nth-child(2),
.permit-search-hint,
.permit-search-more {
    color: var(--muted);
}

.permit-search-hint,
.permit-search-more {
    margin: 0;
    font-size: 13px;
}

.permit-project-documents {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.permit-documents-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.permit-documents-head h2 {
    margin: 5px 0 3px;
    font-size: 25px;
}

.permit-documents-head p {
    margin: 0;
    color: var(--muted);
}

.permit-document-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .05);
}

.permit-document-row {
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) 112px minmax(150px, .75fr) minmax(180px, .9fr);
    align-items: center;
    gap: 20px;
    min-height: 142px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.permit-document-row:last-child {
    border-bottom: 0;
}

.permit-document-row.is-missing {
    background: #fcfcfb;
}

.permit-document-name {
    display: grid;
    gap: 7px;
}

.permit-document-name strong {
    font-size: 16px;
}

.permit-document-name small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.permit-document-preview,
.permit-document-preview > a,
.permit-document-placeholder,
.permit-document-pdf {
    width: 104px;
    height: 104px;
}

.permit-document-preview > a,
.permit-document-placeholder,
.permit-document-pdf {
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
}

.permit-document-preview > a {
    border: 1px solid #d8dde4;
    background: #f8fafc;
    transition: box-shadow .18s ease, transform .18s ease;
}

.permit-document-preview > a:hover {
    box-shadow: 0 9px 22px rgba(15, 23, 42, .14);
    transform: translateY(-2px);
}

.permit-document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.permit-document-pdf {
    align-content: center;
    gap: 5px;
    background: #fff4f2;
    color: #b42318;
}

.permit-document-pdf b {
    font-size: 22px;
    letter-spacing: .08em;
}

.permit-document-pdf small,
.permit-document-placeholder small {
    font-size: 11px;
    font-weight: 800;
}

.permit-document-placeholder {
    align-content: center;
    gap: 5px;
    border: 1px dashed #c7ced8;
    background: #f8fafc;
    color: #98a2b3;
}

.permit-document-placeholder b {
    font-size: 25px;
    font-weight: 500;
}

.permit-document-upload-form .button {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.permit-document-upload-form input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.permit-document-visibility {
    display: grid;
    gap: 9px;
}

.permit-document-visibility > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.permit-visibility-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.permit-visibility-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permit-visibility-switch span {
    position: relative;
    width: 48px;
    height: 26px;
    border-radius: 999px;
    background: #cdd3dc;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    transition: background .18s ease;
}

.permit-visibility-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
    transition: transform .18s ease;
}

.permit-visibility-switch input:checked + span {
    background: #15985f;
}

.permit-visibility-switch input:checked + span::after {
    transform: translateX(22px);
}

.permit-visibility-switch input:focus-visible + span {
    outline: 3px solid rgba(239, 141, 36, .3);
    outline-offset: 2px;
}

.permit-visibility-switch b {
    min-width: 34px;
    font-size: 13px;
}

.permit-billing-table td:first-child { min-width: 210px; }
.permit-billing-table td:nth-child(3) { min-width: 240px; }
.permit-billing-readonly { color: var(--muted); font-weight: 800; }

.permit-visibility-pending {
    font-weight: 600 !important;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.partner-docs {
    margin-top: 18px;
}

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

.file-tile {
    min-height: 112px;
    border: 1px dashed #cfd3d8;
    border-radius: var(--radius);
    background: #fbfbfa;
    display: grid;
    place-items: center;
    padding: 14px;
    text-align: center;
    cursor: pointer;
}

.file-tile span {
    margin: 0;
    color: #374151;
    font-size: 13px;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
}

.file-tile input {
    width: 1px;
    min-height: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.tag-list span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}

.mobile-action-bar {
    display: none;
}

.permit-overview-priorities {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.permit-overview-priority {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 238px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.permit-overview-priority::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--brand);
}
.permit-overview-priority.ready::before { background: var(--green); }
.permit-overview-priority.billing::before { background: #3976d9; }
.permit-overview-priority > div { display: flex; align-items: center; gap: 14px; margin-top: 15px; }
.permit-overview-priority > div strong { font-size: clamp(34px, 4vw, 52px); line-height: 1; }
.permit-overview-priority h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.permit-overview-priority p { margin: 15px 0 20px; color: var(--muted); line-height: 1.55; }
.permit-overview-priority > a { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; color: #1f2937; font-weight: 900; }
.permit-overview-priority > a span { color: #b96513; }

.permit-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: start;
    gap: 22px;
}
.permit-attention-panel,
.permit-process-summary {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}
.permit-overview-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.permit-overview-section-head h2,
.permit-process-summary h2 { margin: 4px 0 0; }
.permit-overview-section-head > span { color: var(--muted); font-size: 13px; font-weight: 800; }
.permit-attention-group { margin-top: 20px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.permit-attention-group > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; background: #f8f9fb; }
.permit-attention-group.ready > header { background: #edf9f4; }
.permit-attention-group.waiting > header { background: #fff7e9; }
.permit-attention-group.billing > header { background: #eef4ff; }
.permit-attention-group h3 { margin: 0; font-size: 15px; }
.permit-attention-group > header span { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 999px; background: #fff; font-weight: 900; }
.permit-attention-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px 15px; border-top: 1px solid var(--line); color: var(--text); }
.permit-attention-item:hover { background: #fafafa; }
.permit-attention-item > span { display: grid; gap: 4px; min-width: 0; }
.permit-attention-item > span:last-child { grid-template-columns: minmax(0, 1fr) auto; align-items: center; text-align: right; }
.permit-attention-item small { color: var(--muted); line-height: 1.4; }
.permit-attention-item b { color: #b96513; font-size: 18px; }
.permit-attention-empty { margin: 0; padding: 15px; border-top: 1px solid var(--line); color: #39745d; background: #fbfdfc; }
.permit-attention-more { display: block; padding: 12px 15px; border-top: 1px solid var(--line); color: #9a510f; font-size: 13px; font-weight: 900; text-align: center; }
.permit-process-summary { position: sticky; top: 84px; }
.permit-process-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.permit-process-totals div { display: grid; gap: 4px; border-radius: 12px; padding: 14px; background: #f6f7f9; }
.permit-process-totals strong { font-size: 28px; }
.permit-process-totals span { color: var(--muted); font-size: 12px; font-weight: 800; }
.permit-status-breakdown { border-top: 1px solid var(--line); }
.permit-status-breakdown > div:not(.empty-state) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.permit-status-breakdown span { color: #4b5563; font-size: 13px; line-height: 1.35; }
.permit-status-breakdown strong { display: grid; place-items: center; align-self: start; min-width: 26px; height: 24px; border-radius: 999px; background: var(--brand-soft); color: #99500d; font-size: 12px; }
.permit-overview-quick-links { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 18px; }
.permit-overview-quick-links .button { width: 100%; }

.next-action {
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius);
    background: #f8fafc;
    border: 1px solid var(--line);
}

.next-action strong,
.missing-list strong {
    display: block;
    margin-bottom: 6px;
}

.next-action p {
    margin: 0;
    color: #374151;
}

.missing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.missing-list strong {
    flex: 0 0 100%;
}

.missing-list span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: var(--radius);
    background: #fff1f2;
    color: #be123c;
    font-size: 12px;
    font-weight: 800;
}

.missing-list.ok span {
    background: #e8f8f1;
    color: #047857;
}

.permit-legend {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.legend {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 800;
}

.legend.red { background: #fff1f2; color: #be123c; }
.legend.yellow { background: #fff7ed; color: #c2410c; }
.legend.green { background: #e8f8f1; color: #047857; }

.phase-doc-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.phase-doc {
    display: grid;
    gap: 10px;
    border-left: 4px solid #d1d5db;
}

.phase-doc.success { border-left-color: var(--green); }
.phase-doc.warning { border-left-color: var(--brand); }
.phase-doc.danger { border-left-color: var(--red); }

.phase-doc > strong {
    font-size: 22px;
}

.audit-card {
    margin-top: 18px;
}

.audit-card p {
    min-height: 42px;
    margin: 0;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.audit-card p:last-child {
    border-bottom: 0;
}

.audit-card span {
    color: var(--muted);
}

@media (max-width: 980px) {
    .login-layout {
        grid-template-columns: 1fr;
    }
    .login-hero {
        min-height: auto;
        padding: 32px 24px;
        gap: 80px;
    }
    .login-copy h1 {
        font-size: 42px;
    }
    .login-stats, .admin-cards {
        grid-template-columns: 1fr;
    }
    .login-panel {
        min-height: auto;
        padding: 72px 24px 32px;
    }
    .login-topline {
        top: 24px;
        right: 24px;
    }
    .sidebar {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 32;
        width: 100%;
        height: 58px;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand { height: 58px; }
    .nav-group {
        display: none;
    }
    .nav-label, .sidebar-user { display: none; }
    .nav-item {
        white-space: nowrap;
    }
    .app {
        margin-left: 0;
        padding-top: 122px;
    }
    .topbar {
        position: fixed;
        top: 58px;
        left: 0;
        right: 0;
        z-index: 31;
        padding: 0 28px;
    }
    .current-project {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 2px 10px;
        margin-left: 12px;
    }
    .current-project > span {
        grid-column: 1 / -1;
    }
    .current-project a {
        white-space: nowrap;
    }
    .system-status {
        display: none;
    }
    .topbar-status-group {
        margin-left: auto;
    }
    .project-selector-grid {
        grid-template-columns: 1fr;
    }
    .project-selector-card {
        align-items: stretch;
        flex-direction: column;
    }
    .project-selector-card .button {
        width: 100%;
    }
    .mobile-menu-panel {
        position: fixed;
        top: 134px;
        left: 12px;
        right: 12px;
        z-index: 30;
        display: none;
        gap: 6px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: rgba(255,255,255,.98);
        box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
    }
    .mobile-menu-open .mobile-menu-panel {
        display: grid;
    }
    .mobile-menu-section {
        display: grid;
        gap: 4px;
    }
    .mobile-menu-section + .mobile-menu-section {
        padding-top: 6px;
        border-top: 1px solid var(--line);
    }
    .mobile-menu-panel .nav-label {
        display: block;
        margin: 6px 8px 4px;
    }
    .mobile-menu-panel .nav-item {
        min-height: 42px;
        width: 100%;
    }
    .content {
        width: min(100% - 28px, 1120px);
        padding-top: 28px;
        padding-bottom: 96px;
    }
    .metrics-grid, .split, .form-grid, .upload-grid, .installer-focus, .job-facts, .check-grid, .completion-grid, .phase-doc-grid,
    .permit-overview-priorities, .permit-overview-layout {
        grid-template-columns: 1fr;
    }
    .permit-overview-priority { min-height: 0; }
    .permit-process-summary { position: static; }
    .permit-attention-item { grid-template-columns: 1fr; gap: 8px; }
    .permit-attention-item > span:last-child { text-align: left; }
    .permit-upload-head,
    .permit-upload-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .permit-upload-actions .button {
        width: 100%;
    }
    .permit-project-search > div,
    .permit-document-row {
        grid-template-columns: 1fr;
    }
    .permit-project-result {
        grid-template-columns: 1fr auto;
    }
    .permit-project-result span:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .permit-project-result span:last-child {
        grid-column: 2;
        grid-row: 1;
    }
    .permit-documents-head {
        align-items: stretch;
        flex-direction: column;
    }
    .permit-documents-head .button {
        width: 100%;
    }
    .permit-document-row {
        gap: 14px;
        padding: 18px;
    }
    .permit-document-preview,
    .permit-document-preview > a,
    .permit-document-placeholder,
    .permit-document-pdf {
        width: 100%;
        height: 150px;
    }
    .permit-document-name small {
        white-space: normal;
    }
    .permit-document-visibility {
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }
    .settings-profile {
        grid-template-columns: 1fr;
    }
    .page-header { align-items: flex-start; flex-direction: column; }
    .quick-actions {
        justify-content: flex-start;
    }
    .installer-job-card {
        padding: 18px;
    }
    .job-card-head {
        display: grid;
    }
    table, thead, tbody, tr, th, td { display: block; }
    thead { display: none; }
    tr { border-bottom: 1px solid var(--line); padding: 12px; }
    td { border-bottom: 0; padding: 7px 6px; }
    .upload-inline { justify-content: flex-start; flex-wrap: wrap; }
    .overview-check {
        grid-template-columns: 10px 1fr;
        align-items: start;
    }
    .overview-check .button {
        grid-column: 2;
        justify-self: start;
        margin-top: 4px;
    }
    .system-hero {
        display: grid;
        padding: 22px;
    }
    .system-capacity {
        width: 132px;
    }
    .system-section {
        padding-left: 22px;
        padding-right: 22px;
    }
    .system-facts,
    .system-map-card,
    .system-grid,
    .warranty-grid {
        grid-template-columns: 1fr;
    }
    .system-map {
        min-height: 260px;
    }
    .system-page-head,
    .system-location-card,
    .system-two-col,
    .system-property-card {
        grid-template-columns: 1fr;
        display: grid;
    }
    .system-page-head {
        align-items: flex-start;
    }
    .system-location-card {
        padding: 22px;
    }
    .system-location-power {
        min-width: 0;
        justify-items: start;
    }
    .system-location-power span {
        grid-column: 1 / -1;
    }
    .system-tech-grid {
        grid-template-columns: 1fr;
    }
    .system-tech-grid div,
    .system-tech-grid div:nth-child(2n),
    .system-tech-grid div:nth-last-child(-n+2) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .system-tech-grid div:last-child {
        border-bottom: 0;
    }
    .system-warranty-strip {
        grid-template-columns: 1fr;
    }
    .system-warranty-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .system-warranty-strip div:last-child {
        border-bottom: 0;
    }
    .system-property-map {
        min-height: 240px;
    }
    .library-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .contract-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .sticky-actions {
        position: static;
        display: grid;
        align-items: stretch;
    }
    .quotation-form-grid,
    .quotation-item-row {
        grid-template-columns: 1fr;
    }
    .quotation-item-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .quotation-item-drag-handle {
        grid-row: 1 / span 4;
    }
    .quotation-item-row > label,
    .quotation-item-row > .quotation-remove-item {
        grid-column: 2;
    }
    .quotation-form-grid .wide {
        grid-column: auto;
    }
    .quotation-items-head,
    .quotation-viewer-toolbar,
    .quotation-viewer-toolbar > div {
        align-items: stretch;
        flex-direction: column;
    }
    .quotation-viewer-toolbar .button {
        width: 100%;
    }
    .quotation-pdf-frame {
        height: 72vh;
        min-height: 520px;
    }
    .sticky-actions .button {
        width: 100%;
    }
    .composer-row {
        grid-template-columns: 1fr;
    }
    .composer-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .message-list article {
        grid-template-columns: 36px 1fr;
        align-items: flex-start;
    }
    .message-list time {
        grid-column: 2;
    }
    .message-list .unread {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        margin-top: 4px;
    }
    .mailbox-toolbar {
        flex-wrap: wrap;
    }
    .mailbox-compose-link {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }
    .internal-message-composer {
        padding: 16px;
    }
    .mail-composer-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .mail-composer-actions .button {
        width: 100%;
    }
    .mailbox-row,
    .mailbox-row.is-unread {
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 14px;
    }
    .mail-avatar {
        width: 38px;
        height: 38px;
    }
    .mailbox-row-meta {
        grid-column: 2;
        justify-items: start;
        grid-auto-flow: column;
        justify-content: start;
    }
    .mail-detail {
        padding: 18px;
    }
    .mail-detail header,
    .mail-detail footer {
        align-items: flex-start;
        flex-direction: column;
    }
    .mail-detail footer .button {
        width: 100%;
    }
    .audit-card p {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 10px 0;
    }
    .mobile-action-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        border-top: 1px solid var(--line);
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(12px);
    }
    .mobile-action-bar a {
        min-height: 54px;
        display: grid;
        place-items: center;
        color: #111827;
        font-size: 12px;
        font-weight: 800;
    }
}
.admin-destructive-actions,
.danger-dialog-actions {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}

.danger-dialog {
    width: min(34rem, calc(100vw - 2rem));
    border: 0;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1.5rem 4rem rgba(15, 23, 42, .28);
}

.danger-dialog::backdrop {
    background: rgba(15, 23, 42, .58);
}

.danger-dialog form,
.danger-dialog label {
    display: grid;
    gap: .85rem;
}

.danger-dialog-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Shared quotation editor; legacy forms retain their existing layout. */
#editable-quotation-form .compact-draft-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 110px auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    margin-bottom: 10px;
}
#editable-quotation-form .compact-draft-row > label { display: grid; min-width: 0; gap: 5px; }
#editable-quotation-form .compact-draft-row > .draft-line-details { grid-column: 2 / -1; min-width: 0; }
.draft-drag-handle { cursor: grab; touch-action: none; user-select: none; height: 44px; width: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 26px; }
.is-dragging { outline: 2px solid #32875b; background: #f1faf5; }
.draft-line-details summary, .draft-technical-details summary { cursor: pointer; padding: 6px 0; font-weight: 650; }
.draft-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; padding-top: 12px; }
.draft-detail-grid label { display: grid; min-width: 0; gap: 5px; }
.draft-reorder-fallback { grid-column: 1 / -1; }
.draft-price-overview { display: flex; gap: 24px; flex-wrap: wrap; padding: 14px 0; }
.draft-price-overview > div { display: grid; gap: 4px; }
.draft-price-overview strong { font-size: 20px; }
.draft-offer-block, .draft-items-block { display: grid; gap: 12px; }
.draft-items-block { margin-top: 26px; }
.draft-action-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.draft-actions-block { margin: 20px 0; }
.draft-actions-block .inline-action { margin: 0; }
#editable-quotation-form textarea[readonly] { background: #f4f6f5; }
@media (max-width: 620px) {
    #editable-quotation-form .compact-draft-row { grid-template-columns: 44px minmax(0,1fr) 84px; gap: 8px; padding: 10px; }
    #editable-quotation-form .compact-draft-row > .draft-product { grid-column: 2 / -1; }
    #editable-quotation-form .compact-draft-row > .draft-quantity { grid-column: 2; }
    #editable-quotation-form .compact-draft-row > [data-line-delete] { grid-column: 3; justify-self: start; }
    #editable-quotation-form .compact-draft-row > .draft-line-details { grid-column: 1 / -1; }
    .draft-detail-grid { grid-template-columns: minmax(0,1fr); }
    .draft-price-overview { gap: 16px; }
    .draft-price-overview strong { font-size: 18px; }
}

.customer-icon-actions{display:ruby-text;align-items:center;gap:8px;flex-wrap:wrap}.customer-icon-actions form{margin:0}.customer-icon-button{width:40px;min-width:40px;height:40px;padding:8px;display:inline-flex;align-items:center;justify-content:center}.customer-icon-button:disabled{opacity:.45;cursor:not-allowed}.customer-icon-button svg{flex-shrink:0}
.customer-icon-actions.contracted-project-actions{flex-wrap:nowrap;min-width:136px}

/* Standalone customer account activation. */
.invite-setup-body{margin:0;min-height:100vh;background:#fff;color:#050b20}
.invite-setup-layout{min-height:100vh;display:grid;place-items:center;padding:32px 24px;box-sizing:border-box}
.invite-setup-panel{width:min(100%,520px)}
.invite-setup-logo{display:block;width:190px;max-width:52%;height:auto;margin:0 0 28px}
.invite-setup-eyebrow{display:block;margin-bottom:20px;color:#52709a;font-size:12px;font-weight:800;letter-spacing:.34em;text-transform:uppercase}
.invite-setup-panel h1{margin:0;font-size:36px;line-height:1.12;letter-spacing:-.035em;color:#020718}
.invite-setup-intro{max-width:500px;margin:14px 0 40px;color:#587093;font-size:15px;line-height:1.7}
.invite-setup-form{display:grid;gap:27px}
.invite-setup-form label{display:grid;gap:10px}
.invite-setup-form label>span:first-child{color:#52709a;font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.invite-setup-form input[type=password],.invite-setup-form input[type=text]{width:100%;height:52px;padding:0 48px 0 16px;border:1px solid #d8e0eb;border-radius:11px;background:#fff;color:#071126;font:inherit;box-sizing:border-box;outline:0;transition:border-color .16s,box-shadow .16s}
.invite-setup-form label:not(:first-of-type) input{padding-right:16px}
.invite-setup-form input:focus{border-color:#7188aa;box-shadow:0 0 0 3px rgba(82,112,154,.12)}
.invite-password-field{position:relative;display:block}
.invite-password-toggle{position:absolute;top:50%;right:10px;width:36px;height:36px;padding:0;transform:translateY(-50%);display:grid;place-items:center;border:0;background:transparent;color:#587093;cursor:pointer}
.invite-password-rules{display:grid;gap:8px;margin-top:-7px;color:#587093;font-size:12px}
.invite-password-rules span{display:flex;align-items:center;gap:10px;transition:color .16s,font-weight .16s}
.invite-password-rules i{color:#cbd5e1;font-style:normal;font-size:16px;transition:color .16s}
.invite-password-rules .is-met{color:#087a50;font-weight:700}
.invite-password-rules .is-met i{color:#16a36a}
.invite-setup-submit{width:100%;height:50px;gap:10px;border-radius:11px;background:#03091d!important;border-color:#03091d!important;font-size:13px}
.invite-setup-footer{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:42px;padding-top:27px;border-top:1px solid #dfe5ee;font-size:12px;font-weight:700}
.invite-setup-footer a{color:#52709a;text-decoration:none}
.invite-setup-footer a:hover{text-decoration:underline}
.invite-setup-panel>.notice{margin:28px 0 0}
@media(max-width:560px){.invite-setup-layout{place-items:start center;padding:48px 20px}.invite-setup-panel h1{font-size:31px}.invite-setup-eyebrow{letter-spacing:.25em}.invite-setup-intro{margin-bottom:32px}.invite-setup-footer{align-items:flex-start;flex-direction:column;gap:14px}}

/* Phase 4B field editor: presentation only; totals remain server-owned. */
.quotation-editor-shell { --editor-muted: #718096; --editor-accent: #197452; color: var(--ink, #17243b); }
.draft-editor-heading { padding-left: 15px; padding-right: 15px; display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0 0 16px; font-size: 13px; color: var(--editor-muted); }
.draft-editor-heading > span { font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.draft-summary-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.draft-summary-card, .quotation-editor-shell .quotation-editor-card { background: #fff; border: 1px solid var(--line,#e3e8ee); border-radius: 20px; box-shadow: 0 5px 16px rgba(23,36,59,.045); }
.draft-summary-card { display: grid; align-content: start; gap: 9px; padding: 22px; min-width: 0; }
.draft-summary-card > span { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .055em; color: var(--editor-muted); }
.draft-summary-card > strong { font-size: clamp(21px,2.3vw,29px); line-height: 1.15; letter-spacing: -.025em; }
.draft-summary-card small { line-height: 1.5; color: var(--editor-muted); }
.draft-summary-card.offer-total { background: #dcf4e5; border-color: #c9ead7; }
.quotation-editor-shell .quotation-edit-form { margin: 0; padding: 0; border: 0; background: transparent; }
.quotation-editor-shell fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.quotation-editor-layout { display: grid; grid-template-columns: minmax(0,7fr) minmax(270px,3fr); gap: 24px; align-items: start; }
.quotation-editor-main, .quotation-editor-sidebar { display: grid; gap: 22px; min-width: 0; }
.quotation-editor-shell .quotation-editor-card { padding: 24px; margin: 0; min-width: 0; }
.quotation-editor-shell h2 { margin: 0 0 18px; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.draft-card-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.quotation-editor-shell .draft-card-heading h2 { margin: 0; }
.draft-item-count { padding: 5px 11px; border-radius: 99px; font-size: 12px; white-space: nowrap; background: #eaf3fa; color: #315773; }
.quotation-editor-shell .draft-items-block { display: block; }
#editable-quotation-form .compact-draft-row { grid-template-columns: 32px 24px minmax(0,1fr) 80px 40px; gap: 6px 8px; padding: 12px 0; margin: 0; align-items: center; border: 0; border-bottom: 1px solid var(--line,#e3e8ee); border-radius: 0; background: transparent; }
#editable-quotation-form .compact-draft-row:last-child { border-bottom: 0; }
#editable-quotation-form .compact-draft-row > .draft-product { grid-column: 3; }
#editable-quotation-form .compact-draft-row > .draft-quantity { grid-column: 4; }
#editable-quotation-form .compact-draft-row > [data-line-delete] { grid-column: 5; justify-self: center; }
#editable-quotation-form .compact-draft-row > .draft-line-details { grid-column: 3 / -1; }
.quotation-editor-shell .draft-line-number { color: var(--editor-accent); font-size: 13px; font-weight: 750; }
.quotation-editor-shell .draft-drag-handle { width: 32px; min-height: 44px; height: 44px; border: 0; background: transparent; color: var(--editor-muted); font-size: 23px; }
.quotation-editor-shell input, .quotation-editor-shell textarea, .quotation-editor-shell select { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; font: inherit; color: inherit; border: 1px solid var(--line,#dce3e9); border-radius: 10px; background: #fff; padding: 11px 12px; }
.quotation-editor-shell input:focus, .quotation-editor-shell textarea:focus, .quotation-editor-shell select:focus { outline: 2px solid #96c3ad; outline-offset: 2px; }
.quotation-editor-shell textarea { resize: vertical; line-height: 1.5; }
.quotation-editor-shell input[readonly] { background: #f4f7f9; color: var(--editor-muted); }
#editable-quotation-form .draft-product input { border-color: transparent; padding: 8px 2px; font-weight: 600; min-height: 44px; text-overflow: ellipsis; }
#editable-quotation-form .draft-product input:hover { border-color: var(--line,#dce3e9); }
#editable-quotation-form .draft-quantity input { text-align: center; min-height: 44px; border-radius: 14px; background: #edf5fc; padding: 8px 3px; }
.quotation-editor-shell .draft-delete-icon { display: grid; place-items: center; width: 40px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: #d53245; cursor: pointer; }
.quotation-editor-shell .draft-delete-icon:hover { background: #fff0f2; }
.quotation-editor-shell .draft-line-details summary { font-size: 12px; font-weight: 550; color: var(--editor-muted); padding: 0 0 4px; }
.quotation-editor-shell .draft-detail-grid { border-radius: 12px; background: #f3f7fa; padding: 16px; margin-top: 9px; gap: 14px; }
.quotation-editor-shell label { display: grid; min-width: 0; gap: 7px; }
.quotation-editor-shell label > span { font-size: 13px; font-weight: 550; }
.quotation-editor-shell small, .quotation-editor-shell .quotation-form-note { font-size: 12px; color: var(--editor-muted); line-height: 1.55; }
.quotation-editor-shell .quotation-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.quotation-editor-shell .draft-checkbox { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; line-height: 1.5; font-weight: 400; }
.quotation-editor-shell .draft-checkbox input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; padding: 0; accent-color: #197452; }
.quotation-editor-shell .draft-add-line { width: 100%; margin-top: 18px; min-height: 44px; border: 1px dashed #c8d4df; border-radius: 12px; background: #f7f9fc; }
.quotation-editor-shell .draft-technical-details > summary { padding: 0; font-size: 15px; }
.quotation-editor-shell .draft-summary-edit { margin-top: 18px; }
.quotation-editor-shell .draft-technical-details .draft-checkbox { margin-top: 12px; }
.quotation-editor-shell .draft-technical-details .quotation-form-grid { margin-top: 18px; }
.quotation-editor-shell .draft-cost-card { display: grid; gap: 15px; }
.quotation-editor-shell .draft-cost-card h2 { margin-bottom: 0; }
.draft-cost-total { display: grid; gap: 7px; border-top: 1px solid var(--line,#e3e8ee); padding-top: 18px; }
.draft-cost-total > span { font-weight: 650; font-size: 14px; }
.draft-cost-total > strong { font-size: 27px; letter-spacing: -.025em; line-height: 1.2; }
.quotation-editor-shell .draft-cost-comparison { display: grid; grid-template-columns: minmax(0,1fr); gap: 7px; margin: 0; padding-top: 8px; font-size: 12px; }
.draft-cost-comparison > div { display: flex; justify-content: space-between; gap: 10px; }
.draft-cost-comparison dd { margin: 0; font-weight: 650; }
.draft-price-unchanged { margin: 0; font-size: 12px; color: var(--editor-accent); }
.quotation-editor-shell .draft-action-row { display: grid; gap: 10px; }
.quotation-editor-shell .draft-action-row .button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 12px; }
.draft-preview-button { background: #edf5fc; color: #274e70; border: 1px solid #dce9f4; }
.draft-finalize-button { background: #f3ab29; color: #34240a; border: 1px solid #eaa224; font-weight: 650; }
.draft-abandon-button { min-height: 44px; color: #c52c3d; border: 0; background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.draft-save-status { font-size: 12px; line-height: 1.55; color: var(--editor-muted); margin: 0 0 15px; }
.draft-save-status.has-changes { padding: 11px; background: #fff6e5; color: #775216; border-radius: 10px; }
.draft-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.draft-history li { display: grid; grid-template-columns: 8px auto minmax(0,1fr); gap: 9px; align-items: center; padding: 10px 0; font-size: 12px; }
.draft-history-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccd5df; }
.draft-history-dot.draft { background: #f3ab29; }
.draft-history-dot.sent, .draft-history-dot.final { background: #79be99; }
.draft-history li > a { grid-column: 2 / -1; justify-self: start; padding: 5px 8px; font-size: 11px; }
.quotation-editor-shell .is-dragging { background: #f0f8f4 !important; border-radius: 8px !important; }
.draft-visually-hidden, #editable-quotation-form .draft-product > span, #editable-quotation-form .draft-quantity > span { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
    .quotation-editor-layout { grid-template-columns: minmax(0,1fr); }
    .quotation-editor-sidebar { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .quotation-editor-sidebar .quotation-version-section { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .draft-summary-cards, .quotation-editor-sidebar, .quotation-editor-shell .quotation-form-grid { grid-template-columns: minmax(0,1fr); }
    .quotation-editor-sidebar .quotation-version-section { grid-column: auto; }
    .draft-summary-cards { gap: 10px; margin-bottom: 16px; }
    .draft-summary-card { padding: 18px; gap: 6px; }
    .quotation-editor-layout, .quotation-editor-main, .quotation-editor-sidebar { gap: 16px; }
    .quotation-editor-shell .quotation-editor-card { padding: 18px 14px; border-radius: 16px; }
    #editable-quotation-form .compact-draft-row { grid-template-columns: 28px 20px minmax(0,1fr) 62px 32px; column-gap: 5px; }
    .quotation-editor-shell .draft-drag-handle { width: 28px; }
    .quotation-editor-shell .draft-delete-icon { width: 32px; }
    .quotation-editor-shell .draft-detail-grid { grid-template-columns: minmax(0,1fr); padding: 12px; }
    .draft-editor-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
}

/* Customer project context: shared visual language with the quotation editor. */
.admin-customer-header { gap: 20px; margin-bottom: 20px; }
.admin-customer-header h1 { letter-spacing: -.025em; }
.admin-customer-header .admin-customer-back { gap: 9px; border-radius: 14px; min-height: 42px; font-weight: 550; box-shadow: 0 2px 4px rgba(28,43,63,.04); }
.admin-customer-list-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-customer-notice.success { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; padding: 10px 15px; margin: 0 0 18px; border-radius: 99px; background: #dcf4e5; color: #176546; font-weight: 500; line-height: 1.5; }
.admin-notice-check { display: grid; place-items: center; flex: 0 0 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
.admin-project-context { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 18px; padding: 22px 24px; margin-bottom: 14px; border-radius: 20px; box-shadow: 0 3px 12px rgba(28,43,63,.035); }
.admin-project-context .admin-project-label { padding-top: 13px; margin: 0; font-size: 14px; font-weight: 650; text-transform: none; letter-spacing: normal; }
.admin-project-selection { display: grid; gap: 10px; min-width: 0; }
.admin-project-context .admin-project-selection select { width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #d0e0ee; border-radius: 14px; background: #edf5fc; font: inherit; color: inherit; }
.admin-project-selection > small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-project-selection > .button { justify-self: start; }
.admin-detail-tabs { gap: 8px; padding: 0 0 24px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.admin-detail-tabs .button { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 9px 14px; border-radius: 99px; font-weight: 550; white-space: nowrap; box-shadow: 0 2px 4px rgba(28,43,63,.035); }
.admin-tab-complete { display: inline-grid; place-items: center; flex: 0 0 17px; width: 17px; height: 17px; border-radius: 50%; background: #d9f3e5; color: #147a53; font-size: 11px; font-weight: 800; line-height: 1; }
.admin-detail-tabs .button[aria-current="page"] { background: #16835a; color: #fff; border-color: #16835a; }
.admin-detail-tabs .button[aria-current="page"] .admin-tab-complete { background: #fff; color: #147a53; }
.admin-detail-tabs .button[aria-current="page"]:hover { background: #116d4a; }
.admin-detail-tabs .button:focus-visible, .admin-project-selection select:focus-visible { outline: 2px solid #16835a; outline-offset: 3px; }
.admin-quotation-heading .page-header { margin-bottom: 14px; padding-left: 15px;}
.admin-quotation-heading .page-header h1 { font-size: 24px; letter-spacing: -.025em; }
.admin-quotation-heading .page-header p { margin-top: 6px; font-size: 13px; line-height: 1.5; }
.quotation-context-caption { padding-left: 15px; display: flex; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.quotation-context-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #f3ab29; }
@media (max-width: 760px) {
    .admin-project-context { grid-template-columns: minmax(0,1fr); gap: 9px; padding: 18px 16px; border-radius: 16px; }
    .admin-project-context .admin-project-label { padding-top: 0; }
    .admin-detail-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 14px; gap: 7px; }
    .admin-detail-tabs .button { min-height: 44px; }
    .admin-customer-notice.success { border-radius: 16px; }
}
/* Phase 4C: independent survey and fieldwork cards. */
.survey-editor-shell fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.survey-editor-shell .quotation-editor-main { gap: 20px; }
.survey-editor-shell [hidden] { display: none !important; }
.survey-fieldwork, .survey-history { margin-bottom: 20px; }
.survey-fieldwork summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.survey-fieldwork form { margin-top: 20px; }
.survey-editor-shell label > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .85rem; }
.survey-editor-shell input:not([type=radio]):not([type=checkbox]), .survey-editor-shell select, .survey-editor-shell textarea { width: 100%; box-sizing: border-box; min-height: 44px; }
.survey-phase-options { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.survey-phase-options label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 14px; border-radius: 14px; background: #eef6fc; }
.survey-phase-options input, .survey-editor-shell .draft-checkbox input { width: 20px; height: 20px; }
.survey-roof-row { padding: 16px; margin-top: 16px; border: 1px solid #e3e9ef; background: #f8fafc; border-radius: 16px; }
.survey-roof-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* Customer overview reference layout. */
.customer-overview .overview-project-detail svg,
.customer-overview .overview-check-icon,
.customer-overview .overview-task-header,
.customer-overview .overview-help {
    display: none;
}

@media (min-width: 981px) {
    .customer-overview-page .content {
        width: min(1056px, calc(100vw - 300px));
        padding-top: 46px;
    }

    .customer-overview .page-header {
        margin-bottom: 34px;
    }

    .customer-overview .page-header .eyebrow,
    .customer-overview .overview-phase-card .eyebrow,
    .customer-overview .overview-task-header .eyebrow {
        color: #078347;
        letter-spacing: .025em;
    }

    .customer-overview .page-header h1 {
        margin: 11px 0 12px;
        font-size: 38px;
        line-height: 1.08;
        letter-spacing: -.035em;
    }

    .customer-overview .page-header p {
        max-width: 760px;
        color: #5b6c86;
        font-size: 16px;
        line-height: 1.6;
    }

    .customer-overview .overview-phase-card {
        margin-bottom: 22px;
        padding: 28px 26px 26px;
        border-color: #d4dde9;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-overview .overview-phase-card h2 {
        margin: 10px 0 16px;
        font-size: 23px;
        letter-spacing: -.02em;
    }

    .customer-overview .progress-badge {
        min-width: 48px;
        padding: 7px 11px;
        border-radius: 999px;
        color: #9a6100;
        background: #fff0c8;
        text-align: center;
    }

    .customer-overview .overview-project-detail {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0 0 8px;
        color: #5b6c86;
        font-size: 15px;
        line-height: 1.4;
    }

    .customer-overview .overview-project-detail:last-child {
        margin-bottom: 0;
    }

    .customer-overview .overview-project-detail svg {
        display: block;
        flex: 0 0 18px;
        width: 18px;
        height: 18px;
        fill: none;
        stroke: #078347;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-overview .progress {
        height: 7px;
        margin: 24px 0 10px;
        background: #e9f0f8;
    }

    .customer-overview .phase-labels {
        color: #53627a;
        font-size: 10px;
        letter-spacing: .035em;
    }

    .customer-overview .overview-task-panel {
        overflow: hidden;
        border: 1px solid #d4dde9;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-overview .overview-task-header {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
        padding: 18px 26px;
        border-bottom: 1px solid #dbe3ed;
        background: #f8fbff;
    }

    .customer-overview .overview-task-header-icon,
    .customer-overview .overview-check-icon {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 9px;
        color: #078347;
        background: #d8f7e5;
    }

    .customer-overview .overview-task-header-icon svg,
    .customer-overview .overview-check-icon svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-overview .overview-task-header h2 {
        margin: 7px 0 4px;
        font-size: 18px;
        letter-spacing: -.015em;
    }

    .customer-overview .overview-task-header p {
        margin: 0;
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.5;
    }

    .customer-overview .overview-checklist {
        display: block;
    }

    .customer-overview .overview-check {
        min-height: 86px;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 18px;
        padding: 18px 26px;
        border: 0;
        border-bottom: 1px solid #dbe3ed;
        border-radius: 0;
        background: #fff;
    }

    .customer-overview .overview-check:last-child {
        border-bottom: 0;
    }

    .customer-overview .overview-check > .state-dot {
        display: none;
    }

    .customer-overview .overview-check.warning .overview-check-icon {
        color: #9a6100;
        background: #fff0c8;
    }

    .customer-overview .overview-check strong {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 0 0 4px;
        font-size: 17px;
    }

    .customer-overview .overview-check strong::before {
        content: "";
        flex: 0 0 8px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #078347;
    }

    .customer-overview .overview-check.warning strong::before {
        background: #a76700;
    }

    .customer-overview .overview-check p {
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.5;
    }

    .customer-overview .overview-check .button {
        min-height: 40px;
        border-color: #c9d5e5;
        border-radius: 9px;
        color: #13233b;
        background: #f5f9ff;
        box-shadow: 0 2px 4px rgba(37, 56, 88, .08);
    }

    .customer-overview .overview-check.neutral .button {
        color: #8a929f;
        background: #f7f9fc;
    }

    .customer-overview .overview-help {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 24px auto 0;
        color: #62738d;
        font-size: 12px;
        line-height: 1.5;
        text-align: center;
    }

    .customer-overview .overview-help svg {
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
}

@media (max-width: 980px) {
    .app.customer-overview-page {
        background: #eef4fd;
    }

    .customer-overview-page .content {
        width: min(100% - 28px, 680px);
        padding-top: 26px;
    }

    .customer-overview .page-header {
        gap: 0;
        margin-bottom: 22px;
    }

    .customer-overview .page-header .eyebrow,
    .customer-overview .overview-phase-card .eyebrow,
    .customer-overview .overview-task-header .eyebrow {
        color: #078347;
        letter-spacing: .025em;
    }

    .customer-overview .page-header h1 {
        margin: 9px 0 12px;
        font-size: clamp(28px, 7.5vw, 36px);
        line-height: 1.08;
        letter-spacing: -.035em;
    }

    .customer-overview .page-header p {
        max-width: 650px;
        color: #5b6c86;
        font-size: 15px;
        line-height: 1.65;
    }

    .customer-overview .overview-phase-card {
        margin-bottom: 22px;
        padding: 22px 20px 20px;
        border-color: #d4dde9;
        border-radius: 12px;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-overview .phase-top {
        gap: 14px;
    }

    .customer-overview .phase-top > div {
        min-width: 0;
    }

    .customer-overview .overview-phase-card h2 {
        margin: 9px 0 16px;
        font-size: 21px;
        letter-spacing: -.02em;
    }

    .customer-overview .progress-badge {
        flex: 0 0 auto;
        min-width: 48px;
        padding: 7px 10px;
        border-radius: 999px;
        color: #9a6100;
        background: #fff0c8;
        text-align: center;
    }

    .customer-overview .overview-project-detail {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        min-width: 0;
        margin: 0 0 8px;
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.45;
    }

    .customer-overview .overview-project-detail:last-child {
        margin-bottom: 0;
    }

    .customer-overview .overview-project-detail svg {
        display: block;
        flex: 0 0 17px;
        width: 17px;
        height: 17px;
        margin-top: 1px;
        fill: none;
        stroke: #078347;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-overview .overview-project-detail span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .customer-overview .progress {
        height: 7px;
        margin: 22px 0 10px;
        background: #e9f0f8;
    }

    .customer-overview .phase-labels {
        color: #53627a;
        font-size: 9px;
        letter-spacing: .035em;
    }

    .customer-overview .overview-task-panel {
        overflow: hidden;
        border: 1px solid #d4dde9;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-overview .overview-task-header {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 16px;
        padding: 20px;
        border-bottom: 1px solid #dbe3ed;
        background: #f8fbff;
    }

    .customer-overview .overview-task-header-icon,
    .customer-overview .overview-check-icon {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 9px;
        color: #078347;
        background: #d8f7e5;
    }

    .customer-overview .overview-task-header-icon svg,
    .customer-overview .overview-check-icon svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-overview .overview-task-header h2 {
        margin: 7px 0 5px;
        font-size: 18px;
        letter-spacing: -.015em;
    }

    .customer-overview .overview-task-header p {
        margin: 0;
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.5;
    }

    .customer-overview .overview-checklist {
        display: block;
    }

    .customer-overview .overview-check {
        min-height: 0;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 14px 16px;
        padding: 18px 20px;
        border: 0;
        border-bottom: 1px solid #dbe3ed;
        border-radius: 0;
        background: #fff;
    }

    .customer-overview .overview-check:last-child {
        border-bottom: 0;
    }

    .customer-overview .overview-check > .state-dot {
        display: none;
    }

    .customer-overview .overview-check.warning .overview-check-icon {
        color: #9a6100;
        background: #fff0c8;
    }

    .customer-overview .overview-check > div {
        min-width: 0;
    }

    .customer-overview .overview-check strong {
        display: flex;
        align-items: center;
        gap: 9px;
        margin: 1px 0 5px;
        font-size: 16px;
    }

    .customer-overview .overview-check strong::before {
        content: "";
        flex: 0 0 8px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #078347;
    }

    .customer-overview .overview-check.warning strong::before {
        background: #a76700;
    }

    .customer-overview .overview-check p {
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.5;
    }

    .customer-overview .overview-check .button {
        grid-column: 2;
        justify-self: start;
        min-height: 42px;
        margin-top: 0;
        border-color: #c9d5e5;
        border-radius: 9px;
        color: #13233b;
        background: #f5f9ff;
        box-shadow: 0 2px 4px rgba(37, 56, 88, .08);
    }

    .customer-overview .overview-check.neutral .button {
        color: #8a929f;
        background: #f7f9fc;
    }

    .customer-overview .overview-help {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        gap: 8px;
        margin: 22px auto 0;
        color: #62738d;
        font-size: 12px;
        line-height: 1.5;
        text-align: center;
    }

    .customer-overview .overview-help svg {
        flex: 0 0 16px;
        width: 16px;
        height: 16px;
        margin-top: 1px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
}

@media (max-width: 480px) {
    .customer-overview-page .content {
        width: min(100% - 24px, 680px);
    }

    .customer-overview .overview-phase-card {
        padding: 20px 17px 18px;
    }

    .customer-overview .overview-task-header,
    .customer-overview .overview-check {
        padding-left: 17px;
        padding-right: 17px;
    }

    .customer-overview .overview-check .button {
        width: 100%;
    }
}

@media (min-width: 600px) and (max-width: 980px) {
    .customer-overview .overview-check {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center;
    }

    .customer-overview .overview-check .button {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }
}

/* Customer project status: desktop reference layout with the existing mobile timeline retained. */
.customer-status .status-summary-stats,
.customer-status .status-phase-position,
.customer-status .status-workflow-header,
.customer-status .status-stage-badge,
.customer-status .status-phase-number,
.customer-status .status-help {
    display: none;
}

.customer-status .status-phase-marker svg {
    display: none;
}

@media (min-width: 981px) {
    .customer-status-page .content {
        width: min(1056px, calc(100vw - 300px));
        padding-top: 46px;
    }

    .customer-status .page-header {
        margin-bottom: 34px;
    }

    .customer-status .page-header .eyebrow,
    .customer-status .status-workflow-header .eyebrow {
        color: #078347;
        letter-spacing: .025em;
    }

    .customer-status .page-header h1 {
        margin: 11px 0 12px;
        font-size: 38px;
        line-height: 1.08;
        letter-spacing: -.035em;
    }

    .customer-status .page-header p {
        max-width: 760px;
        color: #5b6c86;
        font-size: 16px;
        line-height: 1.6;
    }

    .customer-status .status-summary-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 364px;
        align-items: center;
        gap: 26px;
        margin-bottom: 22px;
        padding: 34px 26px;
        border-color: #d4dde9;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-status .status-summary-main {
        min-width: 0;
        padding-right: 22px;
        border-right: 1px solid #d7e0eb;
    }

    .customer-status .status-summary-card .phase-top {
        align-items: center;
        gap: 18px;
    }

    .customer-status .status-summary-card .phase-top > div {
        display: flex;
        align-items: baseline;
        min-width: 0;
        gap: 4px;
    }

    .customer-status .status-summary-card .eyebrow {
        color: #111827;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: 0;
        text-transform: none;
    }

    .customer-status .status-summary-card .eyebrow::after {
        content: ":";
    }

    .customer-status .status-summary-card h2 {
        overflow: hidden;
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .customer-status .status-phase-position {
        display: block;
        flex: 0 0 auto;
        margin: 0;
        color: #64748b;
        font-size: 14px;
        white-space: nowrap;
    }

    .customer-status .status-phase-position strong {
        color: #111827;
        font-size: 20px;
    }

    .customer-status .status-mobile-progress {
        display: none;
    }

    .customer-status .status-summary-card .progress {
        height: 9px;
        margin: 18px 0 10px;
        background: #e9f0f8;
    }

    .customer-status .status-summary-card .progress span {
        background: #078347;
    }

    .customer-status .status-summary-note {
        margin: 0;
        color: #64748b;
        font-size: 12px;
        line-height: 1.5;
    }

    .customer-status .status-summary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .customer-status .status-summary-stats > div {
        display: grid;
        place-items: center;
        min-height: 66px;
        padding: 9px 5px;
        border-radius: 8px;
        background: #edf3fc;
        text-align: center;
    }

    .customer-status .status-summary-stats strong {
        color: #56667e;
        font-size: 22px;
        line-height: 1;
    }

    .customer-status .status-summary-stats .complete strong {
        color: #078347;
    }

    .customer-status .status-summary-stats .current strong {
        color: #9a6100;
    }

    .customer-status .status-summary-stats span {
        color: #52627a;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .025em;
        text-transform: uppercase;
    }

    .customer-status .status-workflow {
        display: block;
        overflow: hidden;
        padding: 0;
        border-color: #d4dde9;
        border-radius: 10px;
        box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    }

    .customer-status .status-workflow-header {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
        padding: 18px 26px;
        border-bottom: 1px solid #dbe3ed;
        background: #f8fbff;
    }

    .customer-status .status-workflow-header-icon {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border-radius: 9px;
        color: #078347;
        background: #d8f7e5;
    }

    .customer-status .status-workflow-header-icon svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-status .status-workflow-header h2 {
        margin: 7px 0 4px;
        font-size: 18px;
        letter-spacing: -.015em;
    }

    .customer-status .status-workflow-header p {
        margin: 0;
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.5;
    }

    .customer-status .status-workflow article {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center;
        gap: 18px;
        min-height: 103px;
        padding: 16px 26px;
    }

    .customer-status .status-workflow article.current {
        background: #eaf9ef;
    }

    .customer-status .status-workflow article::after {
        left: 47px;
        top: 57px;
        bottom: -46px;
        background: #d7e0e8;
    }

    .customer-status .status-workflow article.current::after,
    .customer-status .status-workflow article.complete::after {
        background: #b8dcca;
    }

    .customer-status .status-workflow article > .status-phase-marker {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        margin: 0;
        border-radius: 50%;
        color: #65758b;
        background: #eff4fa;
        box-shadow: 0 0 0 4px #fff;
    }

    .customer-status .status-workflow article.current > .status-phase-marker {
        color: #fff;
        background: #078347;
        box-shadow: 0 0 0 4px #eaf9ef;
    }

    .customer-status .status-workflow article.complete > .status-phase-marker {
        color: #078347;
        background: #d8f7e5;
    }

    .customer-status .status-phase-marker svg {
        display: block;
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-status .status-phase-copy {
        min-width: 0;
    }

    .customer-status .status-phase-number {
        display: block;
        margin-bottom: 5px;
        color: #617089;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .035em;
        text-transform: uppercase;
    }

    .customer-status .status-workflow strong {
        margin-bottom: 4px;
        color: #111827;
        font-size: 17px;
    }

    .customer-status .status-workflow small {
        margin: 0;
        color: #5b6c86;
        font-size: 14px;
        line-height: 1.45;
    }

    .customer-status .status-mobile-date {
        display: none;
    }

    .customer-status .status-stage-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        margin: 0;
        z-index: auto;
        gap: 6px;
        min-height: 28px;
        padding: 4px 11px;
        border-radius: 999px;
        color: #52627a;
        background: #edf2f7;
        font-size: 12px;
        font-weight: 700;
        white-space: nowrap;
    }

    .customer-status .status-stage-badge.current {
        color: #9a6100;
        background: #fff0c8;
    }

    .customer-status .status-stage-badge.complete {
        color: #087c47;
        background: #d8f7e5;
    }

    .customer-status .status-stage-badge svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .customer-status .status-help {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 24px auto 0;
        color: #62738d;
        font-size: 12px;
        line-height: 1.5;
        text-align: center;
    }

    .customer-status .status-help > span {
        display: grid;
        place-items: center;
        flex: 0 0 15px;
        width: 15px;
        height: 15px;
        border: 1px solid currentColor;
        border-radius: 50%;
        font-size: 9px;
        font-weight: 800;
    }
}

@media (min-width: 981px) and (max-width: 1150px) {
    .customer-status .page-header h1 {
        font-size: 34px;
    }

    .customer-status .status-summary-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .customer-status .status-summary-main {
        padding: 0 0 18px;
        border-right: 0;
        border-bottom: 1px solid #d7e0eb;
    }
}
.survey-roof-heading button { min-width: 44px; min-height: 44px; }
.survey-action-fields { display: grid; gap: 16px; }
.survey-action-fields button { min-height: 48px; width: 100%; }
.survey-saved-meta { color: var(--muted); font-size: .85rem; margin: 16px 0; }
.survey-history > a { margin: 4px; }
.survey-history form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; align-items: end; }
.survey-history form label { flex: 1; min-width: 180px; }
@media (max-width: 680px) { .survey-editor-shell .quotation-form-grid { grid-template-columns: minmax(0,1fr); } .survey-roof-row { padding: 12px; } .survey-history form { display: grid; } }

/* Historical project-partner assignment controls. */
.admin-partner-assignments { margin-top: 20px; }
.admin-partner-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-partner-heading h2 { margin: 4px 0 0; }
.admin-partner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.admin-partner-card { border: 1px solid #dce7ef; border-radius: 16px; padding: 18px; background: #f9fcff; }
.admin-partner-card h3 { margin: 0 0 12px; }
.admin-partner-current { display: grid; gap: 3px; }
.admin-partner-current span { color: var(--muted); font-size: 12px; }
.admin-partner-form { display: grid; gap: 12px; margin-top: 16px; }
.admin-partner-form .button, .admin-partner-remove-form .button { justify-self: start; }
.admin-partner-remove-form { margin-top: 10px; }
.admin-partner-history { margin-top: 18px; }
.admin-partner-history summary { cursor: pointer; font-weight: 700; }
.admin-partner-history .table-card { margin-top: 12px; }
@media (max-width: 680px) { .admin-partner-grid { grid-template-columns: minmax(0, 1fr); } }

@media (min-width: 701px) and (max-width: 980px) {
    .questionnaire-modern .questionnaire-step-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .questionnaire-page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 26px;
    }
    .questionnaire-page-header h1 {
        font-size: 34px;
    }
    .questionnaire-page-header p {
        font-size: 15px;
    }
    .questionnaire-edit-note {
        padding-bottom: 0;
    }
    .questionnaire-step-header {
        gap: 14px;
        padding: 18px;
    }
    .questionnaire-step-body {
        grid-template-columns: minmax(0, 1fr);
        padding: 20px 18px;
    }
    .questionnaire-modern .field-mailing_address {
        grid-column: auto;
    }
    .questionnaire-submit-card {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 20px 18px;
    }
    .questionnaire-save-button {
        grid-column: 1 / -1;
        width: 100%;
        margin-top: 4px;
    }
}

/* Keep the customer library tabular while matching the questionnaire palette. */
.customer-library-table-wrap {
    overflow-x: auto;
    border-color: #cfd8e3;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 30px rgba(15, 23, 42, .035);
}
.customer-library-table {
    min-width: 790px;
}
.customer-library-table thead {
    background: #f8fafc;
}
.customer-library-table th {
    padding: 18px 22px;
    border-bottom: 1px solid #d7dee8;
    color: #00843d;
    letter-spacing: .04em;
}
.customer-library-table td {
    padding: 20px 22px;
    border-bottom-color: #e2e8f0;
    color: #334155;
}
.customer-library-table td:first-child {
    color: #0f172a;
    font-weight: 700;
}
.customer-library-table tbody tr:hover {
    background: #f8fafc;
}
.customer-library-table td.library-actions {
    display: table-cell;
    white-space: nowrap;
}
.customer-library-table .library-actions .button.ghost {
    border-color: #cfd8e3;
    color: #047857;
}
.customer-library-table .library-actions .button.ghost:hover {
    background: #ecfdf3;
}
.customer-documents-table {
    min-width: 980px;
}
.customer-documents-table td.document-actions {
    width: 330px;
    white-space: normal;
}
.customer-documents-table .upload-inline {
    display: inline-flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    vertical-align: middle;
}
.customer-documents-table td.document-actions > .button {
    margin-right: 8px;
    vertical-align: middle;
}
.customer-documents-table td.document-actions .button,
.customer-documents-table td.document-actions .file-button {
    min-height: 36px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #fff;
    color: #047857;
}
.customer-documents-table td.document-actions .file-button span {
    color: #047857;
    font-weight: 700;
}
.customer-documents-table td.document-actions .button:hover,
.customer-documents-table td.document-actions .file-button:hover {
    background: #ecfdf3;
}

/* Customer Documents: grouped upload workflow matching the approved reference. */
.customer-documents-page {
    display: grid;
    gap: 22px;
}
.customer-documents-summary,
.customer-document-group {
    overflow: hidden;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 30px rgba(15, 23, 42, .035);
}
.customer-documents-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 26px;
    padding: 26px 28px;
}
.customer-documents-summary-progress {
    padding-right: 22px;
    border-right: 1px solid #cfd8e3;
}
.customer-documents-summary-progress > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}
.customer-documents-summary-progress strong { color: #0f172a; }
.customer-documents-summary-progress span { color: #64748b; font-size: 14px; }
.customer-documents-summary-progress span b { color: #0f172a; font-size: 21px; }
.customer-documents-progress {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef3f9;
}
.customer-documents-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #20a36a;
}
.customer-documents-summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 136px);
    gap: 10px;
}
.customer-documents-summary-stats > div {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 68px;
    padding: 9px 16px;
    border-radius: 9px;
    background: #eef3fb;
}
.customer-documents-summary-stats strong { font-size: 21px; line-height: 1; }
.customer-documents-summary-stats span {
    margin-top: 7px;
    color: #526179;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.customer-documents-summary-stats .is-missing strong { color: #ef2e2e; }
.customer-documents-summary-stats .is-uploaded strong { color: #00854a; }
.customer-document-group-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: 18px 26px;
    border-bottom: 1px solid #cfd8e3;
    background: #f7faff;
}
.customer-document-group-icon,
.customer-document-row-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: #edf3fa;
    color: #5c6c7e;
}
.customer-document-group-icon {
    width: 44px;
    height: 44px;
    background: #c9f3d9;
    color: #00864b;
}
.customer-document-row-icon { width: 44px; height: 44px; }
.customer-document-group-icon svg,
.customer-document-row-icon svg,
.customer-document-status svg,
.customer-document-group-status svg,
.customer-document-row-actions svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.customer-document-group-kicker {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 1px 0 7px;
    color: #00843d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.customer-document-group-kicker i { width: 22px; height: 1px; background: #cbd5e1; }
.customer-document-group-header h2 {
    margin: 0 0 5px;
    color: #0f172a;
    font-size: 18px;
}
.customer-document-group-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}
.customer-document-group-status,
.customer-document-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.customer-document-group-status { padding: 5px 10px; }
.customer-document-status { justify-self: start; padding: 5px 11px; }
.customer-document-group-status svg,
.customer-document-status svg { width: 14px; height: 14px; }
.customer-document-group-status.is-missing,
.customer-document-status.is-missing { background: #fee8e6; color: #ef2e2e; }
.customer-document-group-status.is-uploaded,
.customer-document-status.is-uploaded { background: #dcf6e7; color: #00854a; }
.customer-document-group-status.is-optional,
.customer-document-status.is-optional { background: #edf2f7; color: #64748b; }
.customer-document-row {
    display: grid;
    grid-template-columns: auto minmax(250px, 1fr) 150px minmax(390px, auto);
    align-items: center;
    gap: 14px;
    min-height: 90px;
    padding: 17px 26px;
    border-bottom: 1px solid #d9e1ea;
}
.customer-document-row:last-child { border-bottom: 0; }
.customer-document-row-copy { min-width: 0; }
.customer-document-row-copy > strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 17px;
    line-height: 1.25;
}
.customer-document-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.customer-document-format {
    padding: 2px 7px;
    border: 1px solid #cdd8e5;
    border-radius: 4px;
    background: #f4f7fb;
    color: #38516a;
    font-size: 10px;
    font-weight: 700;
}
.customer-document-row-meta small {
    margin-left: 4px;
    color: #64748b;
    font-size: 12px;
}
.customer-document-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    position: relative;
}
.customer-document-upload {
    display: grid;
    grid-template-columns: minmax(248px, 1fr) 124px;
    gap: 8px;
    width: 380px;
}
.customer-document-upload > label:not(.file-button) {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
}
.customer-document-upload > label:not(.file-button) > span {
    color: #38516a;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.customer-document-upload > label:not(.file-button) input {
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid #cbd6e3;
    border-radius: 7px;
    font: inherit;
}
.customer-document-upload .file-button,
.customer-document-upload .button,
.customer-document-view-button,
.customer-document-replace > summary {
    min-height: 45px;
    border-radius: 8px;
}
.customer-document-upload .file-button {
    justify-content: center;
    gap: 9px;
    border: 1px dashed #c4d0de;
    color: #0f172a;
}
.customer-document-upload .file-button svg,
.customer-document-upload .button svg,
.customer-document-view-button svg { width: 18px; height: 18px; }
.customer-document-upload .file-button span { color: #0f172a; font-weight: 700; }
.customer-document-upload .button.dark {
    gap: 8px;
    border-color: #80bea0;
    background: #80bea0;
    color: #fff;
    font-size: 14px;
}
.customer-document-upload .button.dark:hover { border-color: #65aa88; background: #65aa88; }
.customer-document-view-button,
.customer-document-replace > summary {
    gap: 9px;
    border-color: #cbd6e3;
    background: #f5f8fc;
    color: #0f172a;
    box-shadow: 0 2px 4px rgba(15, 23, 42, .08);
}
.customer-document-replace { position: relative; }
.customer-document-replace > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    list-style: none;
}
.customer-document-replace > summary::-webkit-details-marker { display: none; }
.customer-document-replace-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    padding: 12px;
    border: 1px solid #d5dee9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .16);
}
.customer-document-replace-panel .customer-document-upload { width: 100%; }
.customer-document-group-optional .customer-document-row {
    grid-template-columns: auto minmax(170px, 1fr) minmax(390px, auto);
}
.customer-document-group-optional .customer-document-row-actions { grid-column: 3; }
.customer-document-group-optional .customer-document-upload { width: 100%; grid-template-columns: minmax(220px, 1fr) minmax(248px, .55fr) 124px; }
.customer-document-group-optional .customer-document-upload > label:not(.file-button) { grid-column: auto; }
.customer-document-group-contracts .customer-document-row {
    grid-template-columns: auto minmax(250px, 1fr) auto;
    min-height: 84px;
}
.customer-document-group-contracts .customer-document-row-actions { grid-column: 3; }
.customer-document-group-contracts .customer-document-row-copy > strong { margin-bottom: 4px; }
.customer-documents-help {
    margin: 2px 0 0;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}
.customer-documents-help span {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
}
@media (max-width: 1230px) {
    .customer-document-row { grid-template-columns: auto minmax(210px, 1fr) 130px minmax(315px, auto); padding-inline: 20px; }
    .customer-document-upload { grid-template-columns: minmax(190px, 1fr) 116px; width: 315px; }
    .customer-document-group-optional .customer-document-upload { grid-template-columns: minmax(180px, 1fr) minmax(190px, .7fr) 116px; }
}
@media (max-width: 820px) {
    .customer-documents-summary { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
    .customer-documents-summary-progress { padding-right: 0; border-right: 0; }
    .customer-documents-summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-document-group-header { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
    .customer-document-group-header > .customer-document-group-status { grid-column: 2; }
    .customer-document-row,
    .customer-document-group-optional .customer-document-row,
    .customer-document-group-contracts .customer-document-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px 14px;
        padding: 18px;
    }
    .customer-document-status { grid-column: 2; }
    .customer-document-row-actions,
    .customer-document-group-optional .customer-document-row-actions,
    .customer-document-group-contracts .customer-document-row-actions { grid-column: 1 / -1; justify-content: stretch; }
    .customer-document-upload,
    .customer-document-group-optional .customer-document-upload { width: 100%; grid-template-columns: minmax(0, 1fr) 124px; }
    .customer-document-group-optional .customer-document-upload > label:not(.file-button) { grid-column: 1 / -1; }
    .customer-document-view-button,
    .customer-document-replace,
    .customer-document-replace > summary { width: 100%; }
    .customer-document-replace-panel { position: static; width: 100%; margin-top: 8px; }
}
@media (max-width: 520px) {
    .customer-documents-summary-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: 7px; }
    .customer-document-group-header { gap: 13px; }
    .customer-document-group-icon,
    .customer-document-row-icon { width: 40px; height: 40px; }
    .customer-document-group-header p { font-size: 13px; }
    .customer-document-row-copy > strong { font-size: 16px; }
    .customer-document-upload,
    .customer-document-group-optional .customer-document-upload { grid-template-columns: 1fr; }
    .customer-document-upload > label:not(.file-button),
    .customer-document-group-optional .customer-document-upload > label:not(.file-button) { grid-column: auto; }
    .customer-document-upload .file-button,
    .customer-document-upload .button { width: 100%; }
}

/* Project-bound installation photo gallery */
.installation-photo-page { min-width: 0; }
.installation-photo-upload-card {
    display: grid; grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
    gap: 24px; margin: 22px 0 28px; padding: 24px; border: 1px solid #dfe7ef;
    border-radius: 14px; background: #fff; box-shadow: 0 8px 28px rgba(34,55,82,.06);
}
.installation-photo-upload-card h2 { margin: 6px 0 8px; }
.installation-photo-upload-card p { color: #65758c; line-height: 1.5; }
.installation-photo-upload-form,.installation-photo-camera-form { display: grid; align-content: start; gap: 12px; }
.installation-photo-camera-form { grid-column: 2; }
.installation-photo-picker { display: grid; gap: 7px; padding: 14px; border: 1px dashed #9db0c4; border-radius: 10px; background: #f7fafc; }
.installation-photo-picker span,.installation-photo-caption-list span { color: #34445b; font-size: 13px; font-weight: 750; }
.installation-photo-picker input { max-width: 100%; }
.installation-photo-caption-list { display: grid; gap: 9px; }
.installation-photo-caption-list label { display: grid; gap: 5px; min-width: 0; }
.installation-photo-caption-list input { width: 100%; min-width: 0; }
.installation-photo-upload-status { min-height: 20px; margin: 0; font-size: 13px; }
.installation-photo-upload-status.is-error { color: #b42318; font-weight: 700; }
.installation-photo-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 18px; min-width: 0; }
.installation-photo-card { min-width: 0; overflow: hidden; border: 1px solid #dfe7ef; border-radius: 13px; background: #fff; box-shadow: 0 7px 22px rgba(34,55,82,.06); }
.installation-photo-thumb { display: block; aspect-ratio: 4/3; overflow: hidden; background: #e8eef4; }
.installation-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .18s ease; }
.installation-photo-thumb:hover img { transform: scale(1.025); }
.installation-photo-meta { display: grid; gap: 7px; padding: 13px; min-width: 0; }
.installation-photo-meta strong,.installation-photo-meta small { overflow-wrap: anywhere; }
.installation-photo-meta small { color: #718096; }
.installation-photo-delete-button { justify-self: start; margin-top: 3px; }
@media (max-width: 760px) {
    .installation-photo-upload-card { grid-template-columns: minmax(0,1fr); padding: 18px; }
    .installation-photo-camera-form { grid-column: auto; padding-top: 16px; border-top: 1px solid #e4eaf0; }
    .installation-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .installation-photo-meta { padding: 11px; }
    .installation-photo-delete-button { width: 100%; min-height: 44px; }
}
@media (max-width: 390px) {
    .installation-photo-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 980px) {
    .customer-library-table { display: table; }
    .customer-library-table thead { display: table-header-group; }
    .customer-library-table tbody { display: table-row-group; }
    .customer-library-table tr { display: table-row; padding: 0; border: 0; }
    .customer-library-table th,
    .customer-library-table td,
    .customer-library-table td.library-actions { display: table-cell; }
}

/* Installer portal: customer portal visual system, installer business content. */
.mobile-installer-brand { display: none; }
.partner-topbar-context {
    min-width: 0;
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 0 12px;
    margin: 0 auto 0 20px;
}
.partner-topbar-context span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.partner-topbar-context strong { font-size: 14px; }
.installer-portal-page .content {
    width: min(1056px, calc(100vw - 300px));
    padding-top: 46px;
}
.installer-portal .page-header { margin-bottom: 34px; }
.installer-portal .page-header .eyebrow,
.installer-portal .installer-panel-header .eyebrow,
.installer-portal .installer-section-heading .eyebrow {
    color: #078347;
    letter-spacing: .025em;
}
.installer-portal .page-header h1 {
    margin: 11px 0 12px;
    font-size: 38px;
    line-height: 1.08;
    letter-spacing: -.035em;
}
.installer-portal .page-header p {
    max-width: 760px;
    color: #5b6c86;
    font-size: 16px;
    line-height: 1.6;
}
.installer-overview-panel,
.installer-job-card,
.installer-profile-panel {
    overflow: hidden;
    border: 1px solid #d4dde9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
}
.installer-panel-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    background: #f8fbff;
}
.installer-panel-icon,
.installer-project-icon,
.installer-empty-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 9px;
    color: #078347;
    background: #d8f7e5;
}
.installer-panel-icon svg,
.installer-project-icon svg,
.installer-empty-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.installer-panel-header h2 {
    margin: 7px 0 5px;
    font-size: 21px;
    letter-spacing: -.02em;
}
.installer-panel-header p {
    margin: 0;
    color: #5b6c86;
    font-size: 14px;
    line-height: 1.5;
}
.installer-overview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 16px 26px;
    border-top: 1px solid #dbe3ed;
}
.installer-overview-actions .button,
.job-card-actions .button {
    min-height: 40px;
    border-radius: 9px;
}
.installer-overview-actions .button.ghost,
.job-card-actions .button.ghost {
    border-color: #c9d5e5;
    color: #13233b;
    background: #f5f9ff;
    box-shadow: 0 2px 4px rgba(37, 56, 88, .08);
}
.installer-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0 30px;
}
.installer-kpi-card {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 94px;
    padding: 14px 10px;
    border-radius: 9px;
    background: #edf3fc;
    text-align: center;
}
.installer-kpi-card strong {
    color: #56667e;
    font-size: 25px;
    line-height: 1;
}
.installer-kpi-card.approved strong,
.installer-kpi-card.reported strong { color: #078347; }
.installer-kpi-card.ready strong { color: #9a6100; }
.installer-kpi-card span {
    margin-top: 8px;
    color: #52627a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .025em;
    line-height: 1.35;
    text-transform: uppercase;
}
.installer-section-heading { margin-bottom: 14px; }
.installer-section-heading h2 {
    margin: 6px 0 0;
    font-size: 21px;
    letter-spacing: -.02em;
}
.installer-job-list { gap: 18px; }
.installer-job-card { padding: 0; }
.job-card-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto 32px;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 19px 26px;
    border-bottom: 1px solid #dbe3ed;
    background: #f8fbff;
}
.installer-job-card > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.installer-job-card > summary::-webkit-details-marker { display: none; }
.installer-job-card > summary:focus-visible {
    outline: 3px solid rgba(7, 131, 71, .25);
    outline-offset: -3px;
}
.installer-job-card[open] > .job-card-head { border-bottom-color: #dbe3ed; }
.installer-job-summary { min-width: 0; }
.installer-job-address { margin-bottom: 8px !important; }
.installer-job-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    font-size: 13px;
}
.installer-job-contacts a {
    color: #087c47;
    font-weight: 700;
    overflow-wrap: anywhere;
    text-decoration: none;
}
.installer-job-contacts a:hover { text-decoration: underline; }
.installer-job-contacts span { color: #74839a; }
.installer-job-system-summary {
    display: grid;
    justify-items: end;
    gap: 4px;
    min-width: 112px;
    color: #172033;
    text-align: right;
}
.installer-job-system-summary small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; font-weight: 700; }
.installer-job-system-summary strong { font-size: 14px; }
.installer-job-system-summary span { color: #5b6c86; font-size: 13px; font-weight: 700; }
.installer-job-chevron {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #52627a;
    background: #edf2f7;
    transition: transform .18s ease;
}
.installer-job-chevron svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.installer-job-card[open] .installer-job-chevron { transform: rotate(180deg); }
.installer-job-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 26px 8px;
}
.installer-job-detail-heading > div { min-width: 0; }
.installer-job-detail-heading strong { display: block; color: #172033; font-size: 16px; overflow-wrap: anywhere; }
.job-card-head > div { min-width: 0; }
.installer-project-kicker {
    display: block;
    margin-bottom: 5px;
    color: #078347;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.job-card-head h2 {
    margin: 0 0 5px;
    font-size: 19px;
    letter-spacing: -.015em;
}
.job-card-head p { margin: 0; color: #5b6c86; font-size: 14px; }
.installer-status-badge,
.installer-account-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 28px;
    padding: 4px 11px;
    border-radius: 999px;
    color: #52627a;
    background: #edf2f7;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.job-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 8px 26px;
}
.job-facts div {
    min-height: 76px;
    padding: 15px 18px;
    border-right: 1px solid #e1e8f0;
    border-bottom: 1px solid #e1e8f0;
}
.job-facts div:nth-child(3n) { border-right: 0; }
.job-facts div:nth-last-child(-n+3) { border-bottom: 0; }
.job-facts dt {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.job-facts dd {
    margin: 0;
    color: #172033;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.job-card-actions {
    justify-content: flex-end;
    margin: 0;
    padding: 14px 26px 18px;
    border-top: 1px solid #dbe3ed;
}
.installer-schedule-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    align-items: end;
    gap: 22px;
    margin: 8px 26px 18px;
    padding: 18px;
    border: 1px solid #d7e4dc;
    border-radius: 10px;
    background: #f5fbf7;
}
.installer-schedule-panel h3 { margin: 5px 0 6px; font-size: 17px; }
.installer-schedule-panel p { margin: 0; color: #5b6c86; font-size: 13px; line-height: 1.5; }
.installer-schedule-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: end;
    gap: 10px;
}
.installer-schedule-form label { display: grid; gap: 6px; margin: 0; }
.installer-schedule-form label span {
    color: #52627a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.installer-schedule-form input { min-width: 0; min-height: 42px; }
.installer-schedule-form .button { min-height: 42px; white-space: nowrap; }
.installer-schedule-readonly {
    justify-self: end;
    padding: 10px 13px;
    border-radius: 8px;
    color: #087c47;
    background: #d8f7e5;
}
.installer-current-projects .installer-empty-state { max-width: none; }
.installer-empty-state {
    display: grid;
    justify-items: start;
    gap: 8px;
    padding: 26px;
}
.installer-empty-state .installer-empty-icon { margin-bottom: 5px; }
.installer-empty-state h2 { margin: 0; }
.installer-help-card {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 9px;
    margin: 24px auto 0;
    color: #62738d;
    font-size: 12px;
    line-height: 1.5;
}
.installer-help-card p { margin: 3px 0 0; }
.installer-help-icon {
    display: grid;
    place-items: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
}
.installer-documents-page .installer-document-project { margin: 0 0 22px; }
.installer-document-row { grid-template-columns: auto minmax(250px, 1fr) 150px auto; }
.installer-document-empty { padding: 24px 26px; color: #64748b; }
.installer-document-empty p { margin: 0; }
.installer-profile-layout { display: grid; gap: 22px; }
.installer-profile-panel { padding: 22px; }
.installer-profile-avatar { display: grid; justify-items: start; gap: 14px; }
.installer-account-badge { color: #087c47; background: #d8f7e5; }
.installer-account-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.installer-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}
.installer-profile-grid div { min-width: 0; }
.installer-profile-grid dt {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.installer-profile-grid dd {
    min-height: 46px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #d8e0eb;
    border-radius: 10px;
    background: #f7f9fc;
    color: #172033;
    font-size: 14px;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.installer-profile-help { justify-content: flex-start; margin: 0; }

.installer-installation-table-wrap {
    overflow: hidden;
    border: 1px solid #d4dde9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
}
.installer-installation-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.installer-installation-table th {
    padding: 14px 16px;
    border-bottom: 1px solid #dbe3ed;
    color: #52627a;
    background: #f3f7fc;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .025em;
    line-height: 1.35;
    text-align: left;
    text-transform: uppercase;
}
.installer-installation-table th:nth-child(1) { width: 17%; }
.installer-installation-table th:nth-child(2) { width: 20%; }
.installer-installation-table th:nth-child(3) { width: 25%; }
.installer-installation-table th:nth-child(4) { width: 18%; }
.installer-installation-table th:nth-child(5) { width: 20%; }
.installer-installation-table td {
    padding: 17px 16px;
    border-bottom: 1px solid #e5ebf2;
    color: #283850;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    vertical-align: middle;
}
.installer-installation-table tbody tr:last-child td { border-bottom: 0; }
.installer-installation-row {
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease;
}
.installer-installation-row:hover { background: #f1f8f4; }
.installer-installation-row:active { background: #e5f4eb; }
.installer-installation-row:focus-visible {
    outline: 3px solid rgba(7, 131, 71, .28);
    outline-offset: -3px;
    background: #f1f8f4;
}
.installer-installation-row td:first-child strong { color: #087c47; }
.installer-reschedule-action {
    min-height: 40px;
    border-color: #b8c8da;
    border-radius: 9px;
    color: #087c47;
    background: #fff;
    white-space: nowrap;
}
.installer-installation-cards { display: none; }
.installer-installation-card {
    min-width: 0;
    padding: 19px;
    border: 1px solid #d4dde9;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(37, 56, 88, .06);
    cursor: pointer;
}
.installer-installation-card:active { background: #f1f8f4; }
.installer-installation-card:focus-visible {
    outline: 3px solid rgba(7, 131, 71, .28);
    outline-offset: 2px;
}
.installer-installation-date {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #087c47;
    background: #dff6e8;
    font-size: 13px;
    font-weight: 800;
}
.installer-installation-card h2 {
    margin: 0 0 15px;
    color: #172033;
    font-size: 19px;
    overflow-wrap: anywhere;
}
.installer-installation-card dl { display: grid; gap: 12px; margin: 0 0 18px; }
.installer-installation-card dl div { min-width: 0; }
.installer-installation-card dt {
    margin-bottom: 3px;
    color: #738199;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.installer-installation-card dd {
    margin: 0;
    color: #283850;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .role-installer-partner .sidebar { display: none; }
    .role-installer-partner .app { padding-top: 58px; }
    .role-installer-partner .topbar {
        top: 0;
        height: 58px;
        justify-content: flex-end;
        gap: 4px;
        padding: 0 10px 0 8px;
    }
    .role-installer-partner .mobile-installer-brand {
        order: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        margin-right: auto;
    }
    .role-installer-partner .mobile-installer-brand img {
        display: block;
        width: 190px;
        max-width: 46vw;
        height: auto;
    }
    .role-installer-partner .partner-topbar-context { order: 2; }
    .role-installer-partner .menu-toggle { order: 3; flex: 0 0 auto; }
    .role-installer-partner .topbar-status-group { display: none; }
    .role-installer-partner .mobile-menu-panel { top: 70px; }
    .app.installer-portal-page { background: #eef4fd; }
    .installer-portal-page .content {
        width: min(100% - 28px, 680px);
        padding-top: 26px;
    }
    .partner-topbar-context {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        margin: 0;
    }
    .partner-topbar-context span { font-size: 10px; }
    .installer-portal .page-header { gap: 0; margin-bottom: 22px; }
    .installer-portal .page-header h1 {
        margin: 9px 0 12px;
        font-size: clamp(28px, 7.5vw, 36px);
    }
    .installer-portal .page-header p { font-size: 15px; line-height: 1.65; }
    .installer-overview-panel,
    .installer-job-card,
    .installer-profile-panel { border-radius: 12px; }
    .installer-panel-header { padding: 20px; }
    .installer-overview-actions { justify-content: flex-start; padding: 16px 20px 20px; }
    .installer-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .job-card-head {
        grid-template-columns: 44px minmax(0, 1fr) 32px;
        align-items: start;
        padding: 18px 20px;
    }
    .installer-job-system-summary { grid-column: 2; justify-items: start; min-width: 0; text-align: left; }
    .installer-job-chevron { grid-column: 3; grid-row: 1; }
    .installer-job-detail-heading { padding-inline: 20px; }
    .installer-status-badge { justify-self: start; }
    .job-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 20px; }
    .job-facts div:nth-child(3n) { border-right: 1px solid #e1e8f0; }
    .job-facts div:nth-child(2n) { border-right: 0; }
    .job-facts div:nth-last-child(-n+3) { border-bottom: 1px solid #e1e8f0; }
    .job-facts div:nth-last-child(-n+2) { border-bottom: 0; }
    .job-card-actions { padding-inline: 20px; }
    .installer-schedule-panel { grid-template-columns: minmax(0, 1fr); margin-inline: 20px; }
    .installer-schedule-readonly { justify-self: start; }
    .installer-document-row { grid-template-columns: auto minmax(0, 1fr); }
    .installer-profile-panel .settings-profile { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .installer-installation-table-wrap { display: none; }
    .installer-installation-cards { display: grid; gap: 14px; }
    .installer-installation-card .installer-reschedule-action { width: 100%; }
}

@media (max-width: 520px) {
    .installer-portal-page .content { width: min(100% - 24px, 680px); }
    .partner-topbar-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .installer-panel-header { grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 17px; }
    .installer-panel-icon,
    .installer-project-icon,
    .installer-empty-icon { width: 40px; height: 40px; }
    .installer-panel-header h2 { font-size: 19px; }
    .installer-overview-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; padding: 15px 17px 18px; }
    .installer-overview-actions .button,
    .job-card-actions .button { width: 100%; }
    .installer-kpi-grid { gap: 8px; margin: 18px 0 26px; }
    .installer-kpi-card { min-height: 88px; padding-inline: 7px; }
    .installer-kpi-card strong { font-size: 23px; }
    .job-card-head { grid-template-columns: 40px minmax(0, 1fr) 30px; gap: 13px; padding: 17px; }
    .job-card-head h2 { font-size: 18px; }
    .installer-job-contacts { display: grid; gap: 4px; }
    .installer-job-system-summary { display: flex; flex-wrap: wrap; gap: 4px 10px; }
    .installer-job-system-summary small { flex-basis: 100%; }
    .installer-job-detail-heading { display: grid; justify-items: start; padding: 16px 17px 7px; }
    .job-facts { grid-template-columns: minmax(0, 1fr); padding: 5px 17px; }
    .job-facts div,
    .job-facts div:nth-child(2n),
    .job-facts div:nth-child(3n),
    .job-facts div:nth-last-child(-n+2),
    .job-facts div:nth-last-child(-n+3) { min-height: 0; border-right: 0; border-bottom: 1px solid #e1e8f0; }
    .job-facts div:last-child { border-bottom: 0; }
    .job-card-actions { padding: 14px 17px 17px; }
    .installer-schedule-panel { margin: 8px 17px 16px; padding: 16px; }
    .installer-schedule-form { grid-template-columns: minmax(0, 1fr); }
    .installer-schedule-form .button { width: 100%; }
    .installer-empty-state { padding: 22px 18px; }
    .installer-document-row { grid-template-columns: 40px minmax(0, 1fr); }
    .installer-profile-panel { padding: 18px; }
    .installer-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .installer-help-card { justify-content: flex-start; }
}
/* Installer partner PWA install affordance. */
.installer-pwa-install {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid rgba(11, 45, 63, 0.14);
    border-radius: 14px;
    background: #f4f7f5;
    color: #0b2d3f;
}

.installer-pwa-install[hidden] {
    display: none;
}

.installer-pwa-install > div:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.installer-pwa-install span {
    line-height: 1.45;
}

.installer-pwa-install-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

@media (max-width: 600px) {
    .installer-pwa-install {
        align-items: stretch;
        flex-direction: column;
        padding: 15px;
    }

    .installer-pwa-install-actions {
        width: 100%;
    }

    .installer-pwa-install-actions .button {
        min-height: 44px;
        flex: 1 1 0;
    }
}

/* Keep all admin quotation settings reachable in the extended sidebar. */
.role-admin .sidebar{overflow-y:auto}.role-admin .sidebar>.brand,.role-admin .sidebar>.nav-group,.role-admin .sidebar>.sidebar-user{flex-shrink:0}

/* Customer project tabs occupy the persistent topbar. */
.customer-project-topbar { gap: 16px; }
.customer-project-topbar .admin-detail-tabs {
    flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto;
    margin: 0; padding: 4px 0; border: 0; align-items: center;
    justify-content: safe center;
}
.customer-project-topbar .admin-detail-tabs .button { flex: 0 0 auto; }
.customer-project-topbar .topbar-status-group { flex-shrink: 0; }
@media (min-width: 981px) {
    .role-admin .topbar .menu-toggle { display: none; }
}
@media (max-width: 1400px) {
    .customer-project-topbar .topbar-status-group { display: none; }
}
@media (max-width: 980px) {
    .customer-project-topbar { gap: 12px; }
    .customer-project-topbar .menu-toggle { flex-shrink: 0; }
}

/* Compact native selection controls across portal forms. */
:root input[type="checkbox"],
:root input[type="radio"] {
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex: 0 0 18px;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    accent-color: #14825d;
}
.admin-inquiry-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:32px; }
.admin-inquiry-heading .page-header { margin-bottom:0; min-width:0; }
.admin-inquiry-add { flex-shrink:0; font-size:28px; line-height:1; }
.admin-inquiry-dialog { width:min(760px, calc(100vw - 32px)); max-height:90vh; overflow:auto; border:0; border-radius:18px; padding:28px; }
.admin-inquiry-dialog::backdrop { background:rgba(15,23,42,.5); }
.admin-inquiry-form { display:grid; gap:18px; }
.admin-inquiry-form h2, .admin-inquiry-form p { margin:0; }
.admin-inquiry-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.admin-inquiry-fields label { display:grid; gap:6px; }
.admin-inquiry-fields input, .admin-inquiry-fields select { width:100%; min-width:0; box-sizing:border-box; }
@media(max-width:600px) { .admin-inquiry-fields { grid-template-columns:1fr; } .admin-inquiry-dialog { padding:18px; } }
