body {
    font-family: 'Inter', 'Segoe UI', 'Lato', sans-serif;
    text-align: center;
    margin: 0px;
    background-color: #f8fafc;
    color: #334155;
}

.header {
    display: flex;
    background-color: #ffffff;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 68px;
    padding: 0 28px;
}

.header-item {
    display: flex;
    align-items: center;
    height: 6vh;
}

.header-item img {
    height: 100%;
    display: flex;
}

.reportnav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    margin: 20px auto;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    max-width: 1240px;
}

.reportnav .item {
    display: flex;
    margin: 0 4px;
}

.reportnav .item a {
    display: block;
    padding: 9px 12px;
    white-space: nowrap;
}

.header-item {
    padding: 0 18px;
}

.header-item img {
    max-width: 180px;
    object-fit: contain;
}

.header-brand {
    justify-content: flex-start;
    padding: 0;
}

.header-brand img {
    max-height: 48px;
    max-width: 145px;
}

.header-home-link {
    flex: 1;
    justify-content: center;
}

.header-auth-link {
    justify-content: flex-end;
    padding: 0;
}

.logout-button {
    background: #159b65;
    border: 1px solid #159b65;
    border-radius: 6px;
    color: #fff !important;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
}

.logout-button:hover {
    background: #117d52;
    color: #fff !important;
}


.report-container {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    margin-bottom: 50px;
    flex-direction: column;
}

.report-form, .floor-form, .roof-form, .wall-form {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin: 15px;
    display: flex;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.report-form {
    box-sizing: border-box;
    max-width: 1040px;
    width: min(1040px, calc(100% - 32px));
}

.report-form .form-heading {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 22px;
    padding-bottom: 18px;
}

.report-form .form-heading h1 {
    color: #0f172a;
    font-size: 26px;
    margin: 0 0 6px;
}

.report-form .form-heading p {
    color: #64748b;
    margin: 0;
}

.report-form .form-heading .form-kicker {
    color: #159b65;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.report-form > p {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 190px minmax(0, 1fr);
    margin: 0;
    min-height: 54px;
}

.report-form > p label {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    width: auto;
}

.report-form > p input,
.report-form > p select,
.report-form > p textarea {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: inherit;
    min-height: 42px;
    padding: 9px 11px;
    width: 100%;
}

.report-form > p input:focus,
.report-form > p select:focus,
.report-form > p textarea:focus {
    border-color: #159b65;
    box-shadow: 0 0 0 3px rgba(21, 155, 101, .12);
    outline: none;
}

.report-form + button {
    background: #159b65;
    border: 0;
    color: #fff;
    font-weight: 700;
    margin-bottom: 50px;
    min-width: 150px;
}

.report-form + button:hover {
    background: #117d52;
}
.multi-report-form {
    background: transparent;
    box-sizing: border-box;
    max-width: 1040px;
    width: min(1040px, calc(100% - 32px));
}

.workflow-heading {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    margin: 15px 0 18px;
    padding: 24px 28px 20px;
    text-align: left;
}

.report-container > .workflow-heading {
    box-sizing: border-box;
    max-width: 1040px;
    width: min(1040px, calc(100% - 32px));
}

.workflow-heading .form-kicker {
    color: #159b65;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 7px;
    text-transform: uppercase;
}

.workflow-heading h1 {
    color: #0f172a;
    font-size: 26px;
    margin: 0 0 6px;
}

.workflow-heading > p:last-child {
    color: #64748b;
    margin: 0;
}

.floor-form,
.roof-form,
.wall-form {
    box-sizing: border-box;
    margin: 0 0 14px;
    padding: 22px 24px;
    width: 100%;
}

.floor-form > p,
.roof-form > p,
.wall-form > p {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: 220px minmax(0, 1fr);
    margin: 0;
    min-height: 52px;
}

.floor-form label,
.roof-form label,
.wall-form label {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    width: auto;
}

.floor-form input,
.floor-form select,
.floor-form textarea,
.roof-form input,
.roof-form select,
.roof-form textarea,
.wall-form input,
.wall-form select,
.wall-form textarea {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.floor-form input:focus,
.floor-form select:focus,
.floor-form textarea:focus,
.roof-form input:focus,
.roof-form select:focus,
.roof-form textarea:focus,
.wall-form input:focus,
.wall-form select:focus,
.wall-form textarea:focus {
    border-color: #159b65;
    box-shadow: 0 0 0 3px rgba(21, 155, 101, .12);
    outline: none;
}

.workflow-actions {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin: 18px 0 50px;
}

.workflow-actions button,
.workflow-actions .linkbut {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    padding: 11px 18px;
}

.workflow-actions button:last-child,
.workflow-actions .linkbut:last-child {
    background: #159b65;
    border-color: #159b65;
    color: #fff;
}

.workflow-links {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.complete-form {
    margin-top: 0;
}

.inline-file-preview {
    background: #fff;
    border: 1px solid #dce8e2;
    border-radius: 8px;
    margin-top: 12px;
    overflow: hidden;
    padding: 10px;
}

.inline-file-preview img {
    border: 1px solid #d1ddd7;
    border-radius: 6px;
    display: block;
    max-height: 280px;
    max-width: 100%;
    object-fit: contain;
}

.inline-file-preview summary {
    color: #334155;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    list-style-position: inside;
    padding: 15px 16px;
}

.inline-file-preview iframe {
    background: #fff;
    border: 0;
    border-top: 1px solid #dce8e2;
    display: block;
    height: 520px;
    width: 100%;
}

.inline-file-preview {
    position: relative;
}

.delete-file-button {
    background: #fff;
    border: 1px solid #d46d6d;
    border-radius: 5px;
    color: #a33131;
    cursor: pointer;
    font-size: 12px;
    padding: 8px 12px;
    position: absolute;
    right: 10px;
    top: 10px;
}

.delete-file-button:hover {
    background: #fff3f3;
}

.delete-file-button:disabled {
    background: #f8e6e6;
    cursor: default;
}

.file-marked-delete {
    border-color: #d46d6d;
}

.file-marked-delete details {
    opacity: .45;
}

.hidden-clear-input {
    display: none !important;
}

.complete-form > p {
    background: #f8fbfa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: block;
    line-height: 1.7;
    min-height: 0;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.complete-form > p label {
    display: block;
    margin-bottom: 7px;
    width: auto;
}

.complete-form > p input[type="file"] {
    display: block;
    margin-top: 8px;
    max-width: 100%;
}

.complete-form > p a {
    color: #159b65;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.complete-form > p input[type="file"] {
    border: 1px dashed #b8cbc1;
    padding: 10px;
}

.complete-form > p input[type="checkbox"] {
    min-height: auto;
    width: auto;
}

.complete-form > p input[type="checkbox"] + label {
    display: inline;
    font-size: 12px;
    font-weight: 400;
    margin-left: 5px;
}

.complete-actions {
    margin-top: 0;
}

.complete-actions button:first-child {
    background: #fff;
}

.complete-actions .complete-download {
    background: #159b65;
    border-color: #159b65;
    color: #fff;
}


button, .linkbut {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

button:hover, .linkbut:hover {
    background-color: #f1f5f9;
}

a:link, a:visited, a:active {
    text-decoration: none;
    color: #334155;
    transition: color 0.2s;
}

a:hover {
    color: #2563eb;
}

#header a:link, #header a:visited {
    color: #475569;
    font-weight: 500;
}

#header a:hover {
    color: #0f172a;
}


.login-page {
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #eef8f3 100%);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 68px);
    padding: 48px 20px 80px;
}

.login-card {
    background: #fff;
    border: 1px solid #dce8e2;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10);
    box-sizing: border-box;
    max-width: 430px;
    overflow: hidden;
.complete-upload-row {
    display: block !important;
}

.complete-upload-row > label {
    display: block;
    margin-bottom: 10px;
}

.complete-upload-row .inline-file-preview {
    margin-top: 0;
}

.file-change-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.file-change-row > span {
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.file-change-row input[type="file"] {
    border: 1px dashed #b8cbc1;
    margin-top: 0;
    max-width: 100%;
    padding: 7px;
}

.clear-file-option {
    align-items: center;
    color: #64748b;
    display: inline-flex !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    margin: 0 !important;
    white-space: nowrap;
    width: auto !important;
}
    padding: 38px 42px 42px;
    position: relative;
    text-align: left;
    width: 100%;
}

.login-accent {
    background: #159b65;
    height: 5px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.login-kicker {
    color: #159b65;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin: 0 0 10px;
    text-align: left;
    text-transform: uppercase;
}

.login-card h1 {
    color: #0f172a;
    font-size: 30px;
    margin: 0 0 8px;
}

.login-intro {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 28px;
    text-align: left;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    width: auto;
}

.login-form input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: inherit;
    margin-bottom: 10px;
    min-height: 46px;
    padding: 11px 13px;
    width: 100%;
}

.login-form input:focus {
    border-color: #159b65;
    box-shadow: 0 0 0 3px rgba(21, 155, 101, .14);
    outline: none;
}

.login-form button {
    background: #159b65;
    border: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
    min-height: 46px;
    width: 100%;
}

.login-form button:hover {
    background: #117d52;
}


.home-container {
    display: grid;
    gap: 28px;
    grid-template-columns: 230px minmax(0, 1fr);
    margin: 34px auto 70px;
    max-width: 1240px;
    padding: 0 24px;
    text-align: left;
}

.searchpannel {
    align-self: start;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    padding: 20px;
}

.searchpannel h3 {
    color: #0f172a;
    font-size: 16px;
    margin: 0 0 14px;
}

.searchpannel div {
    border-top: 1px solid #eef2f7;
}

.searchpannel a {
    color: #475569;
    display: block;
    padding: 10px 4px;
}

.searchpannel a:hover {
    color: #159b65;
}

.home-main {
    min-width: 0;
}

.home-toolbar {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 14px 18px;
}

.sitem {
    display: flex;
    flex: 1;
    margin: 0;
    max-width: 430px;
}

.search {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: inherit;
    min-height: 40px;
    padding: 9px 12px;
    width: 100%;
}

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

.home-actions a {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    padding: 10px 13px;
    white-space: nowrap;
}

.home-actions a:hover {
    background: #f1f5f9;
}

.home-actions .primary-action {
    background: #159b65;
    border-color: #159b65;
    color: #fff;
}

.mainbit {
    margin-top: 28px;
}

.assessment-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
}

.assessment-heading h2 {
    color: #0f172a;
    font-size: 24px;
    margin: 0;
}

.assessment-heading p {
    color: #64748b;
    margin: 4px 0 0;
}

.assessment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assessment-record {
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: grid;
    gap: 16px;
    grid-template-columns: 65px minmax(0, 1fr) auto;
    padding: 14px 18px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.assessment-record[hidden] {
    display: none;
}

.assessment-record:hover {
    border-color: #8dd7b5;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
    transform: translateY(-1px);
}

.assessment-id {
    color: #159b65;
    font-size: 16px;
    font-weight: 700;
}

.assessment-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.assessment-details strong {
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assessment-details small {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.assessment-arrow {
    color: #159b65;
    font-size: 13px;
    font-weight: 600;
}

.empty-assessments {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    padding: 24px;
    text-align: center;
}


.upgrades-page {
    align-items: center;
    display: flex;
    flex-direction: column;
    margin: 40px auto 80px;
    max-width: 1280px;
    padding: 0 32px;
    width: 100%;
    box-sizing: border-box;
}

.upgrades-intro {
    text-align: center;
    width: 100%;
    margin-bottom: 30px;
}

.upgrades-intro h2 {
    color: #0f172a;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px;
}

.upgrades-intro p {
    color: #64748b;
    margin: 0 0 24px;
    font-size: 16px;
}


.upgrades-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden; 
}

.upgrade-table-header, .upgrade-row {
    display: grid;
    grid-template-columns: 48px minmax(360px, 1fr) 150px 150px 110px;
    gap: 18px;
    align-items: center; 
}

.upgrade-table-header {
    padding: 12px 16px;
    background-color: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.upgrade-rows {
    display: flex;
    flex-direction: column;
}

.upgrade-form-error {
    background: #fff4f4;
    border: 1px solid #f0b4b4;
    border-radius: 6px;
    color: #a33131;
    font-size: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    text-align: left;
}

.upgrade-row {
    min-height: 142px;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.upgrade-row:last-of-type {
    border-bottom: none;
}

.upgrade-row.is-deleted {
    display: none;
}

.input-cell {
    display: flex;
    width: 100%;
}

.row-number-cell {
    justify-content: center;
    font-weight: 600;
    color: #64748b;
}

.input-cell input,
.input-cell textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    height: 46px;
    resize: vertical;
    transition: border-color 0.2s;
}

.input-cell input:focus,
.input-cell textarea:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.upgrade-errors {
    color: #dc2626;
    font-size: 13px;
    text-align: left;
    margin-top: -8px;
    padding-left: 20px;
    grid-column: 1 / -1; 
}


.action-cell {
    display: flex;
    align-items: center;
}

.delete-upgrade-button {
    background: #ffffff;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    font-size: 13px;
    height: 40px;
}

.delete-upgrade-button:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.upgrade-actions {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.add-upgrade-button {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 500;
}

.add-upgrade-button:hover {
    background-color: #e2e8f0;
}

.save-upgrades-button {
    background-color: #10b981 !important;
    border: none;
    color: #ffffff !important;
    padding: 10px 24px;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.save-upgrades-button:hover {
    background-color: #059669 !important;
}


.delete-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.delete-modal-overlay.is-hidden {
    display: none;
}

.saving-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.saving-modal-overlay.is-hidden {
    display: none;
}

.saving-modal-content {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
    color: #334155;
    padding: 28px 44px;
    text-align: center;
}

.saving-modal-content p {
    margin: 0;
    text-align: center;
}

.delete-modal-content {
    background: white;
    padding: 30px 50px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.delete-modal-content p {
    margin: 0;
    font-weight: 500;
    color: #334155;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #dc2626; 
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media (max-width: 768px) {
    .report-form,
    .multi-report-form {
        width: calc(100% - 24px);
    }

    .report-form > p,
    .floor-form > p,
    .roof-form > p,
    .wall-form > p {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 0;
    }

    .workflow-heading {
        padding: 20px;
    }

    .workflow-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .workflow-actions button,
    .workflow-actions .linkbut {
        text-align: center;
        width: 100%;
    }

    .home-container {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .home-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sitem {
        max-width: none;
    }

    .home-actions {
        justify-content: stretch;
    }

    .home-actions a {
        flex: 1;
        text-align: center;
    }

    .upgrade-table-header {
        display: none; 
    }

    .upgrade-row {
        grid-template-columns: 1fr; 
        gap: 10px;
    }

    .row-number-cell {
        justify-content: flex-start;
    }

    .upgrade-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .upgrade-actions button {
        width: 100%;
    }
}

.input-cell textarea {
    height: 110px;
    min-height: 110px;
}

.input-cell:nth-child(2) {
    align-self: stretch;
}