html,
body {
    min-height: 100%;
}

.app-body {
    background: #f4f6f8;
    color: #1f2933;
    font-family: "Segoe UI", Arial, sans-serif;
}

.sidenav {
    background: #ffffff;
    height: 100%;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transition: width .25s ease;
    width: 0;
    z-index: 1040;
}

.sidebar-shell {
    max-width: calc(100vw - 1rem);
    width: 430px;
}

.sidebar-header {
    align-items: center;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    justify-content: space-between;
    padding: 1rem;
}

.sidebar-content {
    padding: 1rem;
}

.project-list-wrap {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: .25rem;
    margin-bottom: 1rem;
    padding: .75rem;
}

.btn-success {
    color: #ffffff;
}

.project-list {
    font-size: .875rem;
    min-height: 2rem;
}

.project-row {
    align-items: center;
    border-bottom: 1px solid #e6edf3;
    display: grid;
    gap: .25rem;
    grid-template-columns: 1fr auto auto;
    padding: .45rem 0;
}

.project-actions {
    grid-column: 1 / -1;
}

.job-meta-wrap {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: .25rem;
    padding: .75rem;
}

.layer-panel {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: .25rem;
    max-width: 42rem;
    padding: .5rem .65rem;
}

.layer-panel-title {
    color: #52606d;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.layer-panel-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .75rem;
}

.layer-item {
    align-items: center;
    color: #334e68;
    cursor: pointer;
    display: inline-flex;
    font-size: .8rem;
    gap: .3rem;
    margin: 0;
}

.layer-item input {
    margin: 0;
}

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

.project-load {
    font-weight: 600;
    padding-left: 0;
    text-align: left;
}

.project-updated {
    color: #829ab1;
    font-size: .75rem;
    grid-column: 1 / -1;
}

.dimension-section {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: .25rem;
    margin-bottom: 1rem;
}

.dimension-title {
    align-items: center;
    background: #edf2f7;
    border-bottom: 1px solid #d9e2ec;
    color: #243b53;
    display: flex;
    font-size: .8125rem;
    font-weight: 700;
    justify-content: space-between;
    letter-spacing: 0;
    padding: .5rem .75rem;
    text-transform: uppercase;
}

.dimension-title .btn {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.1;
    text-transform: none;
}

.dimension-title-actions {
    display: flex;
    gap: .35rem;
}

.dimension-table {
    background: #ffffff;
    font-size: .8125rem;
}

.dimension-table th,
.dimension-table td {
    vertical-align: middle;
}

.dimension-table th[scope="row"] {
    color: #52606d;
    font-weight: 600;
    white-space: nowrap;
}

.dimension-cell {
    min-width: 5.75rem;
}

.dimension-cell .form-control {
    min-width: 3rem;
}

.dimension-cell .btn {
    min-width: 2.25rem;
    padding-left: .4rem;
    padding-right: .4rem;
}

.locked-dimension {
    background-color: #edf2f7;
    color: #52606d;
}

.bow-table .dimension-cell {
    max-width: 12rem;
}

.app-main {
    min-height: 100vh;
    transition: margin-left .25s ease;
}

.app-version-link {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.changelog-body {
    background: #f4f6f8;
}

.changelog-page {
    max-width: 760px;
}

.changelog-header h1 {
    color: #243b53;
}

.changelog-scheme {
    font-style: italic;
}

.changelog-entry {
    border: 1px solid #d9e2ec;
}

.changelog-entry-header {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
}

.changelog-date {
    font-size: .875rem;
    white-space: nowrap;
}

.changelog-changes {
    color: #334e68;
    padding-left: 1.25rem;
}

.report-tools {
    border-top: 1px solid #d9e2ec;
    margin-top: .35rem;
    padding-top: .65rem;
}

.app-navbar {
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
    min-height: 3.5rem;
}

.text-light-50 {
    color: rgba(255, 255, 255, .68);
}

.workspace-toolbar {
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    padding: .75rem 1rem .5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

#appStatus {
    font-size: .875rem;
}

.toolbar-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
}

.compact-tools {
    border-top: 1px solid #edf2f7;
    padding-top: .65rem;
}

.compact-input {
    width: 4.25rem;
}

.tool-input-group {
    width: 18rem;
}

.station-input {
    width: 11rem;
}

.station-tools-break {
    height: 0;
}

.target-inputs {
    width: 21rem;
}

.drawing-panel {
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
}

.workspace-tabs-section {
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
}

.workspace-view-tabs {
    background: #f8fafc;
    padding: .5rem 1rem 0;
}

.workspace-view-content {
    background: #f8fafc;
}

.workspace-view-content > .tab-pane {
    min-height: 24rem;
}

.boat-3d-toolbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    gap: .5rem;
    padding: .5rem 1rem;
}

.boat-3d-status {
    color: #52606d;
    font-size: .8125rem;
    margin-left: .25rem;
}

.boat-3d-viewport {
    height: 520px;
    min-height: 320px;
    overflow: hidden;
    width: 100%;
}

.boat-3d-viewport canvas {
    cursor: grab;
    display: block;
    height: 100%;
    width: 100%;
}

.boat-3d-viewport canvas:active {
    cursor: grabbing;
}

.hydro-page {
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
}

.hydro-page-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    min-height: 2.75rem;
    padding: .55rem 1rem;
}

.hydro-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: flex-end;
}

.hydro-density {
    width: 14.5rem;
}

.hydro-status {
    color: #52606d;
    font-size: .8125rem;
    min-width: 8rem;
}

.hydro-page-body {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(13rem, .8fr) minmax(22rem, 1.3fr) minmax(16rem, 1fr);
    padding: 1rem;
}

.hydro-column h3 {
    color: #243b53;
    font-size: .875rem;
    font-weight: 700;
    margin-bottom: .5rem;
    text-transform: uppercase;
}

.hydro-results {
    border: 1px solid #d9e2ec;
    border-radius: .25rem;
    min-height: 5rem;
    padding: .65rem;
}

.hydro-load-profile {
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    min-height: 13rem;
    overflow: hidden;
    padding: .65rem 1rem;
}

.hydro-load-profile svg {
    display: block;
    height: 12rem;
    width: 100%;
}

.hydro-load-hull {
    fill: rgba(14, 116, 144, .1);
    stroke: #0e7490;
    stroke-width: 2;
}

.hydro-load-waterline {
    stroke: #2563eb;
    stroke-dasharray: 6 5;
    stroke-width: 1.5;
}

.hydro-load-axis {
    stroke: #94a3b8;
    stroke-width: 1;
}

.hydro-load-marker {
    cursor: ew-resize;
}

.hydro-load-marker line {
    stroke: #b91c1c;
    stroke-width: 2.4;
}

.hydro-load-marker polygon,
.hydro-load-marker circle {
    fill: #b91c1c;
}

.hydro-load-marker text {
    fill: #7f1d1d;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.hydro-weight-table,
.hydro-result-table {
    font-size: .8125rem;
}

.hydro-weight-table th,
.hydro-weight-table td,
.hydro-result-table th,
.hydro-result-table td {
    vertical-align: middle;
}

.hydro-weight-table input {
    min-width: 5.5rem;
}

.drawing-panel-header {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    gap: .75rem;
    min-height: 2.25rem;
    padding: .45rem 1rem;
}

.canvas-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    justify-content: flex-end;
}

.canvas-controls.btn-group > .btn {
    border-radius: .2rem;
    margin-left: 0;
}

.canvas-zoom-label {
    color: #52606d;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    padding-left: .25rem;
    text-align: right;
}

.canvas-scroll {
    overflow: auto;
    padding: .75rem 1rem 1rem;
}

.canvas-scroll.is-pan-enabled {
    cursor: grab;
}

.canvas-scroll.is-pan-enabled .drawing-canvas {
    cursor: grab;
}

.canvas-scroll.is-panning,
.canvas-scroll.is-panning .drawing-canvas {
    cursor: grabbing;
    user-select: none;
}

.drawing-canvas {
    background: aliceblue;
    border: 1px solid #bcccdc;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .03);
    display: block;
    max-width: none;
}

.editing-endpoints .drawing-canvas {
    cursor: crosshair;
}

.drawing-canvas.canvas-dot-hover {
    cursor: help;
}

.canvas-dot-tooltip {
    background: rgba(15, 23, 42, .94);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 4px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .22);
    color: #ffffff;
    display: none;
    font-size: .75rem;
    line-height: 1.35;
    max-width: 12rem;
    padding: .35rem .5rem;
    pointer-events: none;
    position: fixed;
    white-space: pre-line;
    z-index: 2000;
}

#endpointEditToggle.btn-warning {
    color: #1f2933;
    font-weight: 600;
}

.stats-output {
    background: #ffffff;
    border-top: 1px solid #d9e2ec;
    font-size: .875rem;
    margin: 0;
    min-height: 3rem;
    overflow-x: auto;
    padding: 1rem;
}

.stats-output:empty::before {
    color: #829ab1;
    content: "Stats output will appear here.";
}

.stats-output table {
    background: #ffffff;
    border-collapse: collapse;
    font-size: .8125rem;
    margin-bottom: 1rem;
    width: 100%;
}

.stats-output h3 {
    font-size: 1rem;
    margin-bottom: .25rem;
}

.stats-output h4 {
    color: #243b53;
    font-size: .9rem;
    margin: 1rem 0 .4rem;
}

.offset-table-header {
    border-bottom: 1px solid #d9e2ec;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
}

.offset-table-header p {
    color: #52606d;
    margin: 0 0 .25rem;
}

.stats-output table.offset-table th {
    background: #f8fafc;
    color: #243b53;
    font-weight: 700;
    text-align: center;
}

.stats-output table.offset-table td,
.stats-output table.offset-table th {
    white-space: nowrap;
}

.stats-output table td,
.stats-output table th {
    border: 1px solid #d9e2ec;
    padding: .35rem .5rem;
}

@media (max-width: 767.98px) {
    .sidebar-shell {
        max-width: calc(100vw - 1rem);
        width: 340px;
    }

    .tool-input-group,
    .station-input,
    .target-inputs {
        width: 100%;
    }

    .workspace-toolbar {
        position: static;
    }

    .boat-3d-viewport {
        height: 360px;
    }

    .hydro-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hydro-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .hydro-density {
        width: 100%;
    }

    .hydro-page-body {
        grid-template-columns: 1fr;
    }

    .drawing-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .canvas-controls {
        justify-content: flex-start;
        margin-left: 0 !important;
    }
}
