:root {
    --blue: #004f9e;
    --bg: #f5f5f5;
    --border: #cfcfcf;
    --text: #111;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: Arial, sans-serif;
    color: var(--text);
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: white;
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 24px;
}

.header img {
    max-height: 90px;
}

.top-actions {
    margin-top: 12px;
    margin-bottom: 24px;
    padding-top: 0;
    border-top: none;
}

.ride-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ride-header-buttons {
    display: flex;
    gap: 8px;
}

.small-header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: #0b4ea2;
    border-radius: 4px;
    line-height: 1;
}

.small-header-button:hover {
    background: #083b7d;
}

.content {
    background: white;
    border: 1px solid var(--border);
    padding: 24px;
}

h1,
h2,
h3 {
    color: var(--blue);
    margin-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group {
    margin-bottom: 14px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    border: 1px solid #bbb;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.route-block {
    border: 1px solid #ddd;
    padding: 16px;
    margin-bottom: 18px;
    background: #fafafa;
}

.check-grid {
    display: grid;
    grid-template-columns: 1fr 120px 140px;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--blue);
}

.check-title-label {
    font-weight: bold;
}

.check-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    font-weight: normal;
}

.check-option input[type="radio"] {
    width: 18px !important;
    min-width: 18px;
    margin: 0;
    order: 1;
}

.check-option span {
    order: 2;
}

button {
    background: var(--blue);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 15px;
}

button:hover {
    opacity: 0.92;
}

@media (max-width: 900px) {

    .page {
        padding: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }
}
.signature-section {
    margin-top: 32px;
}

.signature-box {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    background: #fafafa;
    padding: 18px;
    margin: 0 0 34px 0;
}

.signature-box label {
    display: block;
    margin-bottom: 12px;
    font-weight: bold;
}

.signature-canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 260px;
    border: 2px solid #999;
    background: white;
    touch-action: none;
    box-sizing: border-box;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    margin-bottom: 10px;
}

.signature-actions button {
    min-width: 220px;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.form-actions button {
    min-width: 220px;
}
.form-actions .pdf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 220px;
    padding: 12px 18px;

    background: #1f4e79;
    color: #fff !important;

    text-decoration: none;
    border-radius: 6px;

    font-weight: 600;
    box-sizing: border-box;
}

.form-actions .pdf-button:hover {
    background: #163a59;
}
.signature-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed #999;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: pointer;
}

.signature-preview img {
    max-width: 100%;
    max-height: 130px;
    object-fit: contain;
}

.signature-preview span {
    color: #666;
}

.signature-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.signature-modal-box {
    background: white;
    width: min(900px, 96vw);
    padding: 24px;
    box-sizing: border-box;
}

.signature-modal-canvas {
    width: 100%;
    height: 320px;
    border: 2px solid #333;
    background: white;
    touch-action: none;
    box-sizing: border-box;
}

.signature-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.check-grid label.check-option {
    display: grid !important;
    grid-template-columns: 18px auto !important;
    align-items: center !important;
    justify-content: start !important;
    column-gap: 8px !important;
    width: auto !important;
}

.check-grid label.check-option input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: start !important;
}

.check-grid label.check-option span {
    justify-self: start !important;
}
.check-grid {
    display: grid;
    grid-template-columns: 1fr 120px 140px;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--blue);
}

.check-title-label {
    font-weight: bold;
}

.check-option {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;

    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;

    font-weight: normal;
}

.check-option input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: 0 0 18px !important;
}

.check-option span {
    display: inline-block !important;
}
input[type="time"] {
    width: 180px;
    max-width: 100%;
}

#duration_display {
    width: 220px;
    max-width: 100%;
}
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: auto;
}

.dashboard-table th,
.dashboard-table td {
    border: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

.dashboard-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.dashboard-table tr:nth-child(even) {
    background: #fafafa;
}

.dashboard-table td {
    word-break: break-word;
}

.dashboard-table th:nth-child(1) {
    width: 140px;
}

.dashboard-table th:nth-child(2),
.dashboard-table th:nth-child(3) {
    width: 170px;
}

.dashboard-table th:nth-child(4) {
    width: 120px;
}

.dashboard-table th:nth-child(5) {
    width: 110px;
}

.dashboard-table th:nth-child(6) {
    width: 170px;
}

.dashboard-table th:nth-child(7) {
    width: 160px;
}

.table-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.table-actions form {
    margin: 0;
}

.table-button {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;

    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.2;

    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;

    color: white !important;
    text-align: center;
}

.table-button.edit {
    background: var(--blue);
}

.table-button.pdf {
   background: var(--blue);
}

.table-button.delete {
    background: #b00020;
}

.table-button:hover {
    opacity: 0.92;
}
#syncOfflineButton {
    display: none;
}
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #eef5ff;
}
.header img {
    transition: opacity 0.2s ease;
}

.header:hover img {
    opacity: 0.85;
}
.dashboard-userline {
    font-size: 18px;
    margin-bottom: 24px;
}

.userline-separator {
    margin: 0 10px;
    color: #666;
}

.profile-link {
    color: #004f9e;
    text-decoration: none;
    font-weight: 600;
}

.profile-link:hover {
    text-decoration: underline;
}
.profile-form {
    max-width: 900px;
}

.profile-separator {
    margin: 28px 0;
    border: none;
    border-top: 1px solid var(--border);
}
.pdf-toolbar {
    padding: 12px;
    background: #f2f4f7;
    display: flex;
    gap: 12px;
    align-items: center;
}

.pdf-top-button {
    background: #004f9e;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
}

.pdf-top-button:hover {
    background: #003d7a;
}
.content .error {
    background: #ffe5e5 !important;
    border: 2px solid #d60000 !important;
    color: #8b0000 !important;
    padding: 18px !important;
    border-radius: 6px !important;
    margin-bottom: 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.content .error ul {
    margin-top: 12px;
    margin-bottom: 0;
}

.content .error li {
    margin-bottom: 6px;
}
.check-strike-toggle {
    cursor: pointer;
}

.check-strike-toggle.is-struck {
    text-decoration: line-through;
    color: #777;
}