* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f5f4;
    color: #1f2a24;
}

.page {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

h1,
h2 {
    margin-top: 0;
}

.muted {
    color: #66736b;
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cfd8d2;
    border-radius: 10px;
    font-size: 16px;
}

button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #0A6572;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background: #084f59;
}

.message {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    display: none;
}

.message.success {
    display: block;
    background: #e5f4e9;
    color: #245b35;
}

.message.error {
    display: block;
    background: #fdeaea;
    color: #8a1f1f;
}

.list {
    display: grid;
    gap: 10px;
}

.list-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid #e0e7e3;
    border-radius: 10px;
    background: #fbfcfb;
}

.list-item span {
    color: #0A6572;
    font-weight: 600;
}

.list-item small {
    color: #66736b;
}

.error-text {
    color: #8a1f1f;
}

.secondary-button {
    width: auto;
    padding: 10px 14px;
    background: #dfe8e4;
    color: #1f2a24;
}

.secondary-button:hover {
    background: #cfd8d2;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cfd8d2;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-label input {
    width: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

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

.brand-title {
    font-size: 20px;
    color: #0A6572;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-link {
    text-decoration: none;
}

.active-topbar-link {
    background: #0A6572 !important;
    color: #ffffff !important;
}

@media (max-width: 720px) {

    .topbar {
        align-items: stretch;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .secondary-button,
    .topbar-actions .topbar-link {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }
}

.station-map {
    width: 100%;
    height: 360px;
    border-radius: 14px;
    border: 1px solid #cfd8d2;
    overflow: hidden;
    background: #e6ece8;
}

.map-actions {
    display: grid;
    gap: 8px;
}

.map-coordinate-box {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #dfe8e4;
    border-radius: 10px;
    background: #fbfcfb;
}

.map-coordinate-box strong {
    color: #0A6572;
    font-size: 14px;
}

@media (max-width: 520px) {
    .station-map {
        height: 300px;
    }
}

.clickable-list-item {
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: 1px solid #e0e7e3;
    color: inherit;
    font: inherit;
}

.clickable-list-item:hover {
    border-color: #0A6572;
    background: #f2f8f7;
}

.active-list-item {
    border-color: #0A6572;
    background: #e9f5f4;
}

.station-details-box {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid #dfe8e4;
    border-radius: 10px;
    background: #fbfcfb;
    margin-top: 12px;
}

.station-details-box span {
    color: #0A6572;
    font-weight: 600;
}

.station-details-box small {
    color: #66736b;
}

.danger-button {
    width: auto;
    justify-self: start;
    margin-top: 8px;
    padding: 10px 14px;
    background: #8a1f1f;
    color: #ffffff;
}

.danger-button:hover {
    background: #6f1717;
}

[hidden] {
    display: none !important;
}

.nested-card {
    border: 1px solid #dfe8e4;
    border-radius: 12px;
    padding: 14px;
    background: #fbfcfb;
    display: grid;
    gap: 12px;
}

.nested-card h2 {
    margin: 0;
    font-size: 18px;
}

.station-inspection-list {
    display: grid;
    gap: 12px;
}

.station-inspection-item {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe8e4;
    border-radius: 10px;
    background: #ffffff;
}

.report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.service-report {
    overflow-x: auto;
}

.report-page {
    background: #ffffff;
    padding: 18mm 16mm;
    width: 210mm;
    max-width: 100%;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.08);
    font-size: 10px;
    color: #111111;
    font-family: Arial, sans-serif;
}

.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid #cccccc;
}

.report-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: #0A6572;
    margin: 0 0 2px 0;
}

.report-header p {
    font-size: 9px;
    color: #555555;
    margin: 0;
}

.report-header-right {
    text-align: right;
    font-size: 9px;
    color: #555555;
    line-height: 1.4;
}

.report-section {
    margin-bottom: 14px;
    padding-top: 10px;
    border-top: 0.5px solid #cccccc;
}

.report-section h2 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.report-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 9px;
}

.report-table th,
.report-table td {
    border: 0.5px solid #cccccc;
    padding: 4px;
    text-align: left;
    vertical-align: top;
}

.report-table th {
    background: #f3f4f6;
    font-weight: 700;
}

.report-text {
    font-size: 10px;
    line-height: 1.35;
    white-space: pre-wrap;
}

.report-footer {
    font-size: 8px;
    color: #666666;
    margin-top: 12px;
}

.image-preview-wrapper {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #dfe8e4;
    border-radius: 10px;
    background: #fbfcfb;
}

.image-preview {
    max-width: 220px;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid #dfe8e4;
    border-radius: 8px;
    background: #ffffff;
    padding: 6px;
}

.signature-preview {
    max-width: 260px;
    max-height: 100px;
}

.signature-box {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dfe8e4;
    border-radius: 10px;
    background: #fbfcfb;
}

#signatureCanvas {
    width: 100%;
    height: 180px;
    border: 1px solid #cfd8d2;
    border-radius: 8px;
    background: #ffffff;
    touch-action: none;
}

.report-header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.report-logo {
    max-width: 70px;
    max-height: 50px;
    object-fit: contain;
}

.report-signature {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    border: 0.5px solid #cccccc;
    padding: 6px;
    background: #ffffff;
}

.saving-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 42, 36, 0.55);
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
}

.saving-box {
    width: min(360px, 100%);
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    display: grid;
    gap: 10px;
    text-align: center;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.saving-box p {
    margin: 0;
    color: #66736b;
}

.spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border: 4px solid #dfe8e4;
    border-top-color: #0A6572;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.65;
    cursor: wait;
}