/* --- Base & Variables --- */
:root {
    --bg-dark-start: #000000;
    --bg-dark-end: #1a1a1a;
    --bg-medium: #192924;
    --bg-light: #202f2b;
    --accent-primary: #273631;
    --accent-secondary: #2e3d38;
    --text-light: #f0f0f0;
    --text-medium: #a0a0a0;
    --error-color: #ff8a80;
    --border-radius: 8px;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --brand-red: #273631; 
}

/* --- General Body & Container --- */
body {
    font-family: var(--font-body);
    background-color: var(--bg-dark-start);
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Header & Navigation --- */
.main-header {
    padding: 1rem 0;
    background-color: var(--bg-dark-start);
    border-bottom: 0px solid var(--accent-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    width: auto;
    display: block;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-medium);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-light);
}

/* --- Hero Section --- */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 9rem 0;
    min-height: 50vh;
}

.hero-content {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- START: MODIFIED STYLES --- */
.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1; /* Tighter line height */
    color: var(--text-light);
}

.hero-title span {
    display: block; /* Forces "Redefined" onto a new line */
    margin-top: -0.1em; /* Pulls the second line up slightly */
    color: var(--brand-red); /* Sets the text color to red */
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1rem; /* Made subtitle smaller */
    color: var(--text-light); /* Changed color to light */
    margin-bottom: 2rem; /* Adjusted spacing */
}
/* --- END: MODIFIED STYLES --- */


/* --- Search, Input & Feedback --- */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.address-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent-secondary);
    background-color: rgba(30, 30, 30, 0.5);
    color: var(--text-light);
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: var(--font-body);
}

.address-input:focus {
    outline: none;
    border-color: var(--text-light);
    box-shadow: 0 0 0 3px rgba(240, 240, 240, 0.1);
}

.address-input::placeholder {
    color: var(--text-medium);
}

.spinner {
    border: 4px solid var(--accent-secondary);
    border-top: 4px solid var(--text-light);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 1rem auto 0;
}

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

.error-message {
    color: var(--error-color);
    margin-top: 1rem;
    font-weight: 600;
    background-color: rgba(0,0,0,0.5);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    display: inline-block;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem 0;
}

/* --- THIS IS THE FIX --- */
/* Ensure the borehole logging modal always appears on top of other modals */
#layers-modal-overlay {
    z-index: 1010;
}

/* Ensure groundwater and termination modals appear on top of the layers modal */
#groundwater-modal-overlay,
#termination-modal-overlay {
    z-index: 1020;
}


.modal {
    background: var(--bg-dark-end);
    color: var(--text-light);
    padding: 20px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 650px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid var(--accent-secondary);
    transition: max-width 0.4s ease-in-out;
    max-height: 95vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--accent-secondary);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    font-size: 0.9rem;
}

.modal-body strong {
    color: var(--text-medium);
}

.modal-map-container {
    height: 250px;
    background-color: #111;
    border-radius: 4px;
    margin: 15px 0;
    transition: height 0.4s ease-in-out;
}

.modal-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--accent-secondary);
}

.modal-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.modal-options input[type="checkbox"] {
    margin-right: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal.enlarged {
    max-width: 800px;
}

.modal.enlarged .modal-map-container {
    height: 450px;
}

/* --- Buttons --- */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body);
    text-decoration: none;
}

.btn-primary {
    background-color: #333;
    color: var(--text-light);
    border: 1px solid #444;
}

.btn-primary:hover {
    background-color: #444;
    border-color: #555;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border: 1px solid var(--accent-secondary);
}

.btn-secondary:hover {
    background-color: #333;
    border-color: #444;
}


a.btn, a.btn:visited {
    color: var(--text-light);
    text-decoration: none;
}

/* --- Footer --- */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--accent-secondary);
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* --- Hamburger Menu & Responsive Navigation --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1011;
}

.hamburger-bar {
    width: 2rem;
    height: 0.25rem;
    background-color: var(--text-light);
    border-radius: 10px;
    transition: all 0.3s linear;
}

/* --- CONSOLIDATED REPORT PAGE STYLES --- */
.report-content-new {
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

#report-main-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.7rem;
}

.project-info-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.site-address-block {
    text-align: center;
    margin-bottom: 0.5rem;
}

#site-address-main {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin: 0;
}

#site-council-main {
    color: var(--text-medium);
    margin-top: 0.1rem;
}

.street-view-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 405px;
    background-color: var(--bg-medium);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.street-view-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv-not-found {
    color: var(--text-medium);
}

.report-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}
.detail-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}


.detail-item label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.25rem;
}

.detail-item p {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-medium);
    margin: 0;
}

.detail-subtext {
    font-size: 0.9rem !important;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--accent-secondary);
}

.report-actions .btn {
    width: 100%; /* Base width is 100% */
}

.final-disclaimer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--accent-secondary);
    font-size: 0.8rem;
    color: var(--text-medium);
    text-align: center;
}

#disclaimer-page {
    display: none !important;
}


/* --- PRINT STYLES --- */
.print-only {
    display: none;
}

/* --- NEW LOGIN PAGE STYLES --- */
.login-page-main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 4rem 1rem;
    min-height: calc(100vh - 122px - 85px);
    box-sizing: border-box;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    text-align: center;
}

.login-container h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-medium);
    font-weight: 600;
}

.login-btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.login-links {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-links a {
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.login-links a:hover {
    color: var(--text-light);
}

/* --- NEW DASHBOARD STYLES --- */

.dashboard-layout {
    padding: 2rem 0;
}

/* START: REPLACED STYLES FOR HORIZONTAL NAVBAR */
.dashboard-nav {
    display: flex;
    justify-content: center;
    background-color: var(--bg-dark-end);
    border-bottom: 1px solid var(--accent-secondary);
    width: 100%;
    box-sizing: border-box;
    padding: 0 1rem;
}

.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-medium);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.dashboard-nav-item:hover {
    color: var(--text-light);
    background-color: var(--accent-primary);
}

.dashboard-nav-item.active {
    color: var(--text-light);
    font-weight: 600;
    border-bottom-color: var(--text-light);
}
/* END: REPLACED STYLES FOR HORIZONTAL NAVBAR */

.nav-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.dashboard-content {
    flex-grow: 1;
}

/* --- NEW ADMIN DASHBOARD STYLES --- */

.admin-form-container {
    margin-top: 2.5rem;
    padding: 2rem;
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
}

.admin-form-container h3 {
    margin-top: 0;
    font-family: var(--font-heading);
}
/* --- NEW REGISTRATION FORM STYLES --- */

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    width: 100%;
}

/* --- NEW JOB BOOKING DROPDOWN STYLES --- */

.job-type-select {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent-secondary);
    background-color: rgba(30, 30, 30, 0.5);
    color: var(--text-light);
    box-sizing: border-box;
    font-family: var(--font-body);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a0a0a0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 1.5rem center;
    background-size: .65em auto;
    margin-bottom: 1rem;
}

.job-type-select:focus {
    outline: none;
    border-color: var(--text-light);
    box-shadow: 0 0 0 3px rgba(240, 240, 240, 0.1);
}

/* --- NEW FORM NOTE STYLES --- */

.form-note {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- NEW SERVICES PAGE STYLES --- */

#services-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 3rem;
}

.service-card {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: center;
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card.image-left {
    grid-template-columns: 350px 1fr;
}


.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.service-text h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-top: 0;
    color: var(--text-light);
}

.service-text p {
    color: var(--text-medium);
    line-height: 1.7;
}

.service-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
}

/* Modal specific styles */
.modal-image {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

/* --- Textarea Style --- */
textarea.address-input {
    line-height: 1.6;
}
/* --- NEW DASHBOARD HEADER & WIDGET STYLES --- */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.greeting-container {
    display: flex;
    flex-direction: column;
}

.dashboard-header h1 {
    margin: 0;
    line-height: 1.2;
}

#dashboard-date {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-medium);
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.25rem;
}

.weather-icon {
    font-size: 2.5rem;
}

.weather-details {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.weather-temp {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.weather-location {
    font-size: 0.9rem;
    color: var(--text-medium);
}

.weather-error {
    color: var(--text-medium);
    font-style: italic;
}

/* --- NEW UV WIDGET STYLES --- */

.weather-uv {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-left: 1rem;
    border-left: 1px solid var(--accent-secondary);
}

.uv-label {
    font-size: 0.8rem;
    color: var(--text-medium);
    font-weight: 600;
}

.uv-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

/* --- NEW STATS WIDGET STYLES --- */

.stats-section {
    margin-top: 0; /* Align with top of main content */
    width: 250px; /* Fixed width for the sidebar */
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.dashboard-main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.dashboard-main-column {
    flex-grow: 1;
}

.stats-header {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--accent-secondary);
    padding-bottom: 0.6rem;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.stat-card {
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 0.4rem 0;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-medium);
    font-weight: 600;
}

.stat-card p {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
}

/* --- NEW PROJECTS TABLE STYLES --- */

.projects-table-container {
    margin-top: 2rem;
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    overflow: hidden; /* Ensures the rounded corners apply to the table */
}

.projects-table {
    width: 100%;
    border-collapse: collapse; /* Removes gaps between cells */
}

.projects-table th, .projects-table td {
    padding: 0.4rem 0.4rem;
    text-align: left;
    border-bottom: 1px solid var(--accent-secondary);
}

.projects-table thead {
    background-color: var(--accent-primary);
}

.projects-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-light);
}

.projects-table tbody tr:last-child td {
    border-bottom: none; /* Removes border from the last row */
}

.projects-table tbody tr:hover {
    background-color: var(--accent-secondary);
    cursor: pointer; /* This makes the cursor a hand pointer on hover */
}

/* Center align the action column in the projects table */
.projects-table th:nth-child(4),
.projects-table td:nth-child(4) {
    text-align: center;
}

/* Style for site access details in the job list */
.site-access-details {
    display: block;
    font-size: 0.85em;
    color: var(--text-medium);
    font-style: italic;
    margin-top: 0.25rem;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.status-pending {
    background-color: #a88a0a;
    color: #ffffff;
}

.status-badge.status-complete {
    background-color: #27ae60;
    color: #ffffff;
}

/* --- NEW PROJECT FILTER STYLES --- */

.project-filters {
    text-align: right;
}

.filter-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-medium);
    margin-right: 1rem;
}

.filter-options {
    display: inline-flex;
    gap: 1rem;
    background-color: var(--bg-dark-end);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--accent-secondary);
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
}
/* --- RESPONSIVE & PRINT --- */
@media (max-width: 768px) {
/* Main Navigation Responsive */
.nav-right {
    display: none; /* Hide the nav container by default on mobile */
    flex-direction: column;
    gap: 1rem;
    position: absolute;
    top: 100%; /* Position it right below the header */
    right: 0;
    width: 100%;
    background-color: var(--bg-dark-start);
    padding: 1rem 0;
    border-top: 1px solid var(--accent-secondary);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.nav-right.active {
    display: flex; /* Show the container when the hamburger is clicked */
}

.nav-right .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.nav-right .nav-links li {
    text-align: center;
}

.nav-right .nav-links a {
    display: block; /* Make the whole area clickable */
    padding: 1rem 0;
    font-size: 1.1rem;
}

.nav-right .btn-primary {
    margin: 0.5rem auto; /* Center the 'Book Job' button */
    width: calc(100% - 4rem); /* Give it some padding */
    text-align: center;
}

.hamburger {
    display: flex; /* Ensure the hamburger is always visible on mobile */
}

.hero-title {
    font-size: 2.5rem;
}

.logo img {
    height: 50px; /* Adjust height for the smaller logo on mobile */
}

/* Services Page Responsive */
.service-card,
.service-card.image-left {
    grid-template-columns: 1fr;
}

/* Transform the table into a list of cards */
.projects-table thead {
    display: none; /* Hide the table headers on mobile */
}

.projects-table tr {
    display: block;
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.projects-table td {
    display: block;
    text-align: right; /* Aligns content to the right */
    padding-left: 50%; /* Make space for the label */
    position: relative;
    border-bottom: 1px dotted var(--accent-secondary);
}

.projects-table td:last-child {
    border-bottom: none;
}

/* Create the label from the data-label attribute */
.projects-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: calc(50% - 2rem);
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
}

/* Adjust alignment for button cells */
.projects-table td[data-label="Actions"] {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    text-align: center; /* Center the buttons */
}

.projects-table td[data-label="Actions"]::before {
    display: none; /* Hide labels for button rows */
}
}

@media (min-width: 768px) {
.report-actions .btn {
    width: 100%; /* FIX: Override the half-width rule to be full width */
}
}

@media print {
body {
    background-color: #ffffff;
    color: #000000;
    font-size: 10pt;
}
.main-header, .main-footer, #report-actions-container, .hamburger, .final-disclaimer {
    display: none !important;
}
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}
#print-wrapper {
    display: block;
}
.print-page {
    padding: 3mm 5mm 5mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-height: 250mm;
}

.report-content-new, .report-details-grid, #detailed-disclaimer-content {
    flex-grow: 1;
}

.report-content-new {
    border: none !important;
    padding: 0 !important;
    background-color: #ffffff !important;
}

.project-info-bar, .site-address-block, .street-view-container {
    margin-bottom: 1rem;
}
#report-main-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.site-address-block h2 {
    font-size: 1.3rem;
}
.street-view-container {
    height: auto;
    width: 100%;
    aspect-ratio: 4 / 3;
}

.print-only {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    flex-shrink: 0;
}

.print-logo {
    height: 60px;
    width: auto;
    padding: 15px 0;
}

#print-header-date-1, #print-header-date-2, #print-header-date-3 {
    font-size: 10pt;
}

#report-content, #report-details-page, #disclaimer-page {
    display: flex !important;
}

.report-details-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0;
}

.detail-item {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.disclaimer-title {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
#detailed-disclaimer-content p, #detailed-disclaimer-content ul, #detailed-disclaimer-content li {
    font-size: 9pt;
    line-height: 1.4;
    margin-bottom: 0.8rem;
}
.print-footer {
    display: block !important;
    flex-shrink: 0;
    text-align: center;
    font-size: 8pt;
    color: #666;
    border-top: 1px solid #ccc;
    padding-top: 0.5rem;
    margin-top: auto;
}

/* Override web styles for print */
:root {
    --text-light: #000000;
    --text-medium: #444444;
    --bg-dark-end: #ffffff;
    --accent-secondary: #dddddd;
}
}

/* --- NEW TAB NAVIGATION STYLES --- */

.tab-nav {
    display: flex;
    border-bottom: 1px solid var(--accent-secondary);
    margin-bottom: 2rem;
}

.tab-link {
    padding: 0.75rem 1.5rem;
    border: none;
    background-color: transparent;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-heading);
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; /* Aligns with the container's border */
}

.tab-link:hover {
    color: var(--text-light);
}

.tab-link.active {
    color: var(--text-light);
    border-bottom-color: var(--text-light);
}

.tab-content {
    display: none; /* Hide all tab content by default */
}

.tab-content.active {
    display: block; /* Show only the active tab content */
}

/* --- NEW DETAIL PAGE LAYOUT STYLES --- */
.details-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* This overrides the bottom border from .detail-item for the container */
    border-bottom: 1px solid var(--accent-secondary); 
}

.details-row .detail-item {
    flex: 1; /* Allows items to share space */
    border-bottom: none; /* Remove individual borders when in a row */
}

.text-right {
    text-align: right;
}

/* --- Logout Button Style --- */
#logout-btn {
    color: #ff8a80; /* This is the --error-color variable */
}

#logout-btn:hover {
    color: #ff5252; /* A slightly brighter red on hover */
}

/* Style for the project page tabs */
.page-tab-nav {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--accent-secondary);
}

/* --- Field Investigation Page Styles --- */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--accent-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.section-header h3 {
    margin: 0;
}

.btn-add {
    width: 32px;
    height: 32px;
    background-color: var(--accent-primary);
    color: var(--text-light);
    border: 1px solid var(--accent-secondary);
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 3px; /* Optical adjustment for the '+' sign */
    transition: background-color 0.3s ease;
}

.btn-add:hover {
    background-color: var(--accent-secondary);
}

/* --- Borelog Modal Styles --- */

.button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    flex-wrap: wrap; /* Changed from nowrap to wrap */
}

.button-group .btn {
    white-space: nowrap;
}

.borelog-step {
    margin-top: 1.2rem; /* Reduced margin */
}

/* Style for active/selected buttons in a button group */
.button-group .btn.active {
    background-color: var(--text-light);
    color: var(--bg-dark-end);
    font-weight: 600;
    border-color: var(--text-light);
}


/* --- Additional Responsive Dashboard Styles --- */
@media (max-width: 992px) { /* Affects tablets and phones */
/* Make the main layout stack vertically */
.dashboard-layout {
    flex-direction: column;
    gap: 1.5rem;
}

/* Convert the side nav into a horizontal bar */
.dashboard-nav {
    width: 100%;
    display: flex; 
    flex-direction: row; 
    justify-content: space-around; 
    padding: 0.5rem 0; 
}

.dashboard-nav-item {
    margin-bottom: 0;
}

.nav-text {
    display: none; /* Hides text on smaller screens */
}

/* Make the header stack vertically */
.dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}
}

@media (max-width: 768px) { /* Affects phones */
.nav-text {
    display: none;
}

.dashboard-nav-item {
    padding: 0.75rem;
    gap: 0;
}

/* Transform the table into a list of cards */
.projects-table thead {
    display: none; /* Hide the table headers on mobile */
}

.projects-table tr {
    display: block;
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.projects-table td {
    display: block;
    text-align: right; /* Aligns content to the right */
    padding-left: 50%; /* Make space for the label */
    position: relative;
    border-bottom: 1px dotted var(--accent-secondary);
}

.projects-table td:last-child {
    border-bottom: none;
}

/* Create the label from the data-label attribute */
.projects-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    width: calc(50% - 2rem);
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
}

/* Adjust alignment for button cells */
.projects-table td[data-label="Actions"] {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    text-align: center; /* Center the buttons */
}

.projects-table td[data-label="Actions"]::before {
    display: none; /* Hide labels for button rows */
}
}
/* --- Groundwater Input Styles --- */

.groundwater-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.groundwater-input-group .checkbox-label {
    cursor: pointer;
    font-weight: normal; /* Override default bold label style */
    color: var(--text-light);
}

.groundwater-input-group .address-input {
    max-width: 150px; /* Make the depth input smaller */
    padding: 0.5rem 1rem; /* Adjust padding for smaller size */
}

/* --- Borelog Section & Card Styles --- */
.borehole-card {
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.borehole-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--accent-secondary);
}

.borehole-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 0;
}

.borehole-coords {
    font-size: 0.8rem;
    color: var(--text-medium);
    font-style: italic;
}

.borehole-layers-container {
    /* This will hold the soil layers for each borehole */
    min-height: 50px;
}

/* --- Borehole Card Footer & Delete Button --- */

.borehole-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--accent-secondary);
    text-align: right;
}

.btn-delete {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 0.5rem 1rem; /* Make it a bit smaller */
    font-size: 0.9rem;
}

.btn-delete:hover {
    background-color: rgba(255, 138, 128, 0.1); /* A faint red background on hover */
    color: #ff5252;
    border-color: #ff5252;
}

/* --- Vertical Tab Modal Styles --- */

.modal-tab-layout {
    display: flex;
    gap: 1.5rem;
}

.modal-tab-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 120px;
    flex-shrink: 0;
    border-right: 1px solid var(--accent-secondary);
    padding-right: 1.5rem;
}

.modal-tab-nav .tab-link {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background-color: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-tab-nav .tab-link:hover {
    background-color: var(--accent-secondary);
    color: var(--text-light);
}

.modal-tab-nav .tab-link.active {
    background-color: var(--accent-primary);
    color: var(--text-light);
}

.add-new-tab-btn {
    margin-top: 0.5rem;
    font-size: 1.5rem !important;
    text-align: center !important;
    font-weight: bold !important;
}

.modal-tab-content {
    flex-grow: 1;
}

.tab-pane {
    display: none; /* Hide all panes by default */
}

.tab-pane.active {
    display: block; /* Show only the active pane */
}

/* --- Vertical Tab Modal Styles --- */

/* Existing styles for .modal-tab-layout, .modal-tab-nav, .tab-link, .add-new-tab-btn, .modal-tab-content, .tab-pane, .tab-pane.active remain unchanged */

/* New/Modified styles for Depth Inputs within the modal */
.depth-input-group {
    display: flex; /* Makes From and To align horizontally */
    gap: 1rem; /* Space between From and To */
    align-items: center; /* Vertically aligns text and select */
    margin-top: 0.5rem; /* Space below the "Depth" label */
}

.depth-input-group label {
    flex-shrink: 0; /* Prevents "From" / "To" from shrinking */
    width: 30px; /* Gives a fixed width for alignment */
    text-align: right;
    font-size: 0.85rem; /* Smaller font for From/To labels */
    color: var(--text-medium);
}

.depth-input-group select {
    flex-grow: 1; /* Allows the select to fill available space */
    max-width: 150px; /* Prevent it from getting too wide on large screens */
}

/* Responsive adjustment for form-row if needed (can be added to existing .form-row) */
.form-row {
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1; /* Allows form groups to take equal space */
    min-width: 250px; /* Ensures they don't get too small before wrapping */
}

@media (max-width: 768px) {
.modal-tab-layout {
    flex-direction: column; /* Stack tabs and content on small screens */
    gap: 1rem;
}

.modal-tab-nav {
    width: 100%; /* Tabs take full width */
    flex-direction: row; /* Tabs become horizontal */
    flex-wrap: wrap; /* Allow tabs to wrap if many */
    border-right: none;
    border-bottom: 1px solid var(--accent-secondary); /* Separator at bottom */
    padding-right: 0;
    padding-bottom: 1rem;
}

.modal-tab-nav .tab-link {
    width: auto; /* Tabs adjust to content width */
    flex-grow: 1; /* Distribute space among tabs */
    text-align: center;
}

.depth-input-group {
    flex-wrap: wrap; /* From/To can wrap if needed */
    justify-content: space-between;
}

.depth-input-group label {
    width: auto; /* Remove fixed width on small screens */
    text-align: left;
}

.depth-input-group select {
    width: 100%; /* Occupy full width */
    max-width: none;
}
}
/* --- Vertical Tab Modal Styles --- */

/* ... (Your existing vertical tab modal styles) ... */

/* New/Modified styles for Depth Inputs within the modal */
.depth-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.depth-input-group {
    display: flex;
    gap: 0.5rem; /* Reduced gap between label and select */
    align-items: center;
}

.depth-input-group label {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.depth-input-group select {
    flex-grow: 1;
}

/* --- Soil Colour Header & Modifier Buttons --- */

.color-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem; /* Space between header and main color buttons */
}

/* New style for smaller buttons */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}
/* --- Custom Styles for Borehole Card Header (Requested Change) --- */

.borehole-card .borehole-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Add padding-bottom if needed, but it should already be there */
    /* border-bottom: 1px solid var(--accent-secondary); */ /* Should already be there */
}

.borehole-card .borehole-header > div:first-child {
    display: flex;
    flex-direction: column;
}

.borehole-card .header-actions {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between text and button */
}

.borehole-card .edit-layers-text {
    font-size: 0.9rem; /* Adjust size as needed */
    color: var(--text-medium); /* Or a lighter color */
    white-space: nowrap; /* Prevent text from wrapping */
}
/* --- New Modal Navigation Buttons --- */

.nav-separator {
    height: 1px;
    background-color: var(--accent-secondary);
    margin: 0.75rem 0;
}

.modal-nav-btn {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    width: 100%;
    text-align: center;
    border: 1px solid var(--accent-secondary);
    background-color: var(--bg-dark-end);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav-btn:hover,
.modal-nav-btn.active {
    background-color: var(--accent-primary);
    color: var(--text-light);
    border-color: var(--accent-primary);
}

/* Responsive adjustments for these buttons */
@media (max-width: 768px) {
    .nav-separator {
        display: none; /* Hide separator on mobile layout */
    }
    .modal-nav-btn {
        flex-grow: 1; /* Allow them to grow and wrap */
        width: auto;
    }
}
/* --- New styles for modal action items --- */

.nav-action-item {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.nav-action-display {
    font-size: 0.8rem;
    color: var(--text-medium);
    text-align: center;
    margin-top: 0.25rem;
    font-style: italic;
    min-height: 1.2em; /* Prevents layout shift */
}
/* --- Site Access Note Editing --- */
#investigation-service {
    cursor: pointer;
    transition: color 0.2s ease;
}

#investigation-service:hover {
    color: var(--text-light);
    text-decoration: underline;
    text-decoration-style: dotted;
}
/* --- Improved Modal Layout for Scrolling --- */

.modal {
    display: flex;
    flex-direction: column; /* Stack header, body, footer vertically */
    max-height: 90vh; /* Limit the modal's max height to 90% of the viewport */
}

.modal-body {
    overflow-y: auto; /* Allow this section to scroll if content overflows */
    flex-grow: 1; /* Allow the body to take up available space */
}

.modal-header,
.modal-footer {
    flex-shrink: 0; /* Prevent header and footer from shrinking */
}

/* --- Site Photo Thumbnail Card Styles --- */
#photos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Responsive grid */
    gap: 1rem; /* Space between cards */
    margin-top: 1rem;
}

.photo-card {
    background-color: var(--card-background); /* Use a card background variable */
    border: 1px solid var(--border-color); /* Subtle border */
    border-radius: var(--border-radius); /* Rounded corners */
    overflow: hidden; /* Ensures content stays within rounded corners */
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-small); /* Add a subtle shadow */
}

.photo-card-img-container {
    width: 100%;
    height: 150px; /* Fixed height for consistent image size */
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--background-dark); /* Placeholder background */
}

.photo-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the container without distortion */
}

.photo-card-body {
    padding: 0.75rem;
    flex-grow: 1; /* Allows the body to take up remaining space */
    display: flex;
    flex-direction: column;
}

.photo-card-description-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius-small);
    background-color: var(--input-background);
    color: var(--text-color);
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    resize: vertical; /* Allow vertical resizing for text area */
    min-height: 50px; /* Minimum height for description */
}

.photo-card-description-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.photo-card-footer {
    display: flex;
    justify-content: flex-end; /* Align delete button to the right */
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-light); /* Slightly different background for footer */
}

/* Adjustments for the delete button if needed */
.delete-photo-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}
.photo-preview-container {
    width: 100%;
    max-height: 300px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: var(--border-radius);
    background-color: var(--background-dark);
}

#modal-photo-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sampled-text {
    color: #FFFFFF;
    font-style: italic;
}

.label-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
/* --- Technical Note Card Styles --- */
.note-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-small);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.note-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.note-body {
    margin: 0;
    color: var(--text-medium);
    white-space: pre-wrap; /* This makes sure your line breaks are displayed */
}

/* --- Section Titles (Shared Style) --- */
.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-light);
    position: relative;
    display: inline-block;
    width: 100%;
}

/* --- Features Bar (Instant Insights, etc) --- */
.features-bar {
    background-color: rgba(30, 30, 30, 0.5); /* Semi-transparent dark background */
    padding: 4rem 0;
    border-bottom: 1px solid var(--accent-secondary);
    border-top: 1px solid var(--accent-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    text-align: center;
}

.feature-item {
    padding: 1rem;
}

.feature-icon {
    font-size: 3rem;
    color: var(--brand-red); /* Match the red accent */
    margin-bottom: 1.5rem;
    display: block;
}

.feature-item h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-family: var(--font-heading);
}

.feature-item p {
    color: var(--text-medium);
    font-size: 1rem;
    line-height: 1.6;
}

/* --- How It Works Section --- */
.how-it-works-section {
    padding: 6rem 0;
    background-color: var(--bg-dark-start);
}

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

.step-card {
    background-color: var(--bg-dark-end);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 2.5rem 2rem;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.step-card:hover {
    transform: translateY(-10px);
    border-color: var(--text-medium);
}

.step-number {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent-primary); /* Subtle background number */
    opacity: 0.3;
    position: absolute;
    top: 0;
    right: 1rem;
    line-height: 1;
    z-index: 0;
}

.step-card h3 {
    font-size: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    color: var(--text-light);
}

.step-card p {
    color: var(--text-medium);
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

/* --- Services Overview Section --- */
.services-section-home {
    padding: 6rem 0;
    background-color: var(--bg-medium); /* Slightly lighter bg to separate sections */
    border-top: 1px solid var(--accent-secondary);
}

.services-grid-home {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card-home {
    background-color: var(--bg-dark-start);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: left;
    transition: background-color 0.3s ease;
    height: 100%;
    box-sizing: border-box;
}

.service-card-home:hover {
    background-color: var(--bg-dark-end);
    border-color: var(--text-medium);
}

.service-card-home h3 {
    color: var(--text-light);
    margin-top: 0;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.service-card-home p {
    color: var(--text-medium);
    margin: 0;
    line-height: 1.6;
}

.data-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.data-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--accent-secondary);
    font-size: 0.9rem;
}

.data-list li:last-child {
    border-bottom: none;
}

.data-list .icon {
    font-size: 1.1rem;
}

.data-available .icon {
    color: #27ae60; /* Green */
}

.data-unavailable {
    opacity: 0.6;
}

.data-unavailable .icon {
    color: #e74c3c; /* Red */
}