/* =========================================================
BASE / LAYOUT
========================================================= */

body {
    font-family: Segoe UI, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
}

.skip-link:focus {
    left: 0;
}

.header {
    background-color: #3F5364;
    color: #ffffff;
    padding: 10px 20px;
}

/* Shared page container */
.page-container {
    max-width: var(--page-max-width, 900px);
    margin: var(--page-margin, 0 auto);
    padding: var(--page-padding, 20px);
    box-sizing: border-box;
}

/* Keep existing booking-page vertical rhythm */
.content.page-container {
    --page-max-width: 900px;
    --page-margin: 0 auto;
    --page-padding: 20px;
}

.admin-page-container {
    max-width: 1600px;
    margin: 24px auto;
    padding: 0 24px;
    box-sizing: border-box;
}

#inspectionsTable th,
#inspectionsTable td {
    overflow-wrap: break-word;
}

/* =========================================================
FORM CONTROLS
========================================================= */

.phase-box input[type="text"],
.phase-box input[type="email"],
.phase-box input[type="tel"],
.phase-box input[type="date"],
.phase-box select,
.phase-box textarea,
#contactModal .contact-form-field .form-control {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
}

.phase-box input[type="text"],
.phase-box input[type="email"],
.phase-box input[type="tel"],
.phase-box input[type="date"],
.phase-box select,
.phase-box textarea {
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

.phase-box textarea {
    min-height: 90px;
    resize: vertical;
}

#ContactEmail,
#openContactModalBtn {
    margin-bottom: 1rem;
}

/* =========================================================
BUTTONS
========================================================= */

button {
    border-radius: 6px;
    font-weight: 600;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #FF5B35;
    color: #ffffff;
}

.btn-secondary {
    background-color: #f2f2f2;
    border: 1px solid #d0d0d0;
}

/* =========================================================
BOOKING FLOW
========================================================= */

.phase-box {
    border: 1px solid #ddd;
    padding: 18px;
    border-radius: 8px;
    background: #fafafa;
    margin-bottom: 18px;
}

    .phase-box legend {
        font-weight: 600;
    }

.step-pill {
    display: inline-block;
    background: #2b6cb0;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    margin-right: 8px;
}

.step-helper {
    margin-bottom: 12px;
    color: #555;
    font-size: 0.9rem;
}

/* =========================================================
NEW CONTACT HIGHLIGHT
========================================================= */

.form-group.new-contact-highlight {
    background: #fff8e1;
    border: 2px solid #ff9800;
    padding: 12px;
    border-radius: 6px;
    animation: contactGlow 1.2s ease;
}

@keyframes contactGlow {
    0% {
        box-shadow: 0 0 0 rgba(255,152,0,0);
    }

    50% {
        box-shadow: 0 0 12px rgba(255,152,0,.35);
    }

    100% {
        box-shadow: 0 0 0 rgba(255,152,0,0);
    }
}

/* =========================================================
SAVED CONTACTS
========================================================= */

.saved-box {
    border: 1px solid #ddd;
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 16px;
    border-radius: 6px;
}

.saved-contact {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

    .saved-contact.in-use {
        border: 2px solid #198754;
        background-color: #f1fbf4;
    }

/* =========================================================
?? CONTACT MODAL (NEW � PRODUCTION SAFE)
========================================================= */

.kor-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
}

.kor-modal-content {
    background: #ffffff;
    width: min(96vw, 1400px);
    max-width: 1400px;
    border-radius: 10px;
    padding: 26px;
    box-shadow: 0 18px 55px rgba(0,0,0,.25);
    animation: modalFade .18s ease-out;
    max-height: 90vh;
    overflow: hidden;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* nicer contact rows inside modal */
#contactLookupArea .saved-contact {
    margin-bottom: 10px;
}


/* =========================================================
HEADER / FOOTER
========================================================= */

.site-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-logo {
    height: 64px;
}

.site-title {
    font-size: 24px;
    font-weight: 500;
}

.site-footer {
    background-color: #3F5364;
    color: #ffffff;
    padding: 10px 20px;
    margin-top: 40px;
}

/* =========================================================
ADMIN TABLE � PROFESSIONAL DISPATCH STYLE
========================================================= */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .85rem;
}

    .admin-table th,
    .admin-table td {
        padding: 11px 10px;
        border-bottom: 1px solid #e5e5e5;
        vertical-align: top;
    }

    /* sticky header */
    .admin-table thead th {
        background-color: #3F5364;
        color: white;
        font-weight: 600;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* zebra */
    .admin-table tbody tr:nth-child(even) {
        background: #fcfcfc;
    }

    /* hover */
    .admin-table tbody tr:hover {
        background-color: #eef4ff;
    }

/* ===== COLUMN WIDTHS ===== */

.col-date {
    width: 90px;
}

.col-time {
    width: 110px;
}

.col-job {
    width: 85px;
}

.col-status {
    width: 95px;
}

.col-assigned {
    width: 120px;
}

.col-address {
    width: 220px;
}

.col-contact {
    width: 180px;
}

.col-comments {
    width: 260px;
}

.col-actions {
    width: 210px;
}

/* phone */
.phone {
    color: #555;
    font-size: .85rem;
}

/* clamp comments */
.comments {
    max-width: 260px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* =========================================================
STATUS COLORS
========================================================= */

.admin-table tr[data-status="Unassigned"] td {
    background-color: #fff6f4 !important;
}

.admin-table tr[data-status="Assigned"] td {
    background-color: #f2f7ff !important;
}

.admin-table tr[data-status="Completed"] td {
    background-color: #f3fbf5 !important;
}

.admin-table tr[data-status="Cancelled"] td {
    background-color: #fafafa !important;
    color: #777;
}

tr.status-unassigned {
    border-left: 4px solid #c00;
}

tr.status-assigned {
    border-left: 4px solid #0063b1;
}

tr.status-completed {
    border-left: 4px solid #107c10;
}

tr.status-cancelled {
    border-left: 4px solid #767676;
}

/* =========================================================
PILLS
========================================================= */

.pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.pill-Unassigned {
    background: #fff4f2;
    color: #8a2a11;
}

.pill-Assigned {
    background: #eef6ff;
    color: #0b4a8b;
}

.pill-Completed {
    background: #edf8f0;
    color: #1f5f35;
}

.pill-Cancelled {
    background: #f3f3f3;
    color: #555;
}

.pill-anytime {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

/* AM = morning blue */
.pill-am {
    background: #e6f2ff;
    color: #0b4a8b;
}

/* PM = soft violet */
.pill-pm {
    background: #f1e9ff;
    color: #4b2e83;
}

.sort-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

/* =========================================================
ASSIGN + ACTION BUTTONS
========================================================= */

.assign-inline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
}

.admin-actions-cell {
    min-width: 200px;
}

.admin-assign-select {
    width: 100%;
    min-height: 38px;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    font-size: .75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.admin-btn-set {
    background: #0078d4;
    color: white;
}

.admin-btn-cancel {
    background: #d83b01;
    color: white;
}

.admin-btn-secondary {
    background: #eef2f7;
    color: #2d4154;
    border: 1px solid #cfd7e3;
}

.admin-confirm-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #f7fbff;
}

.admin-confirm-text {
    font-size: .75rem;
    font-weight: 600;
    color: #33485c;
    margin-right: 2px;
}

.admin-cancel-form {
    margin: 0;
}

.admin-action-full {
    width: 100%;
}

/* NEW small helpers */

.summary-email-form {
    margin-top: 12px;
    margin-bottom: 12px;
}

.summary-back-link {
    margin-top: 16px;
}

.admin-status-message {
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid #cce5ff;
    background-color: #e9f3ff;
}

.inspector-email-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.inspector-dropdown {
    width: 260px;
    padding: 6px 8px;
}

.btn-smooth {
    display: inline-block;
    background: #e4e7eb;
    border: 1px solid #cfd6dd;
    color: #2c3e50;
    padding: 7px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
}

    .btn-smooth:hover {
        background: #d7dce1;
    }

.admin-filter-form input[type="text"],
.admin-filter-form input[type="date"] {
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

.admin-filter-form input[type="text"]:focus,
.admin-filter-form input[type="date"]:focus {
    outline: none;
    border-color: #7fb1e1;
    background-color: #fafdff;
    box-shadow: 0 0 0 3px rgba(54, 127, 197, 0.16);
}
.step2-wrapper.step2-locked .phase-box {
    background: #fff3f3;
    border: 1px solid #e5a5a5;
    opacity: 0.85;
}

.step-lock-overlay {
    margin-top: 8px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border: 1px solid #e5a5a5;
    border-radius: 6px;
    background: #fff3f3;
    color: #8b1f1f;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Contact modal polish */
.contact-modal-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 700;
}

#contactModal .contact-modal-subtitle {
    margin: 0 0 18px;
    line-height: 1.45;
    color: #5c6773;
    font-size: 0.9rem;
}

#contactModal .contact-section {
    margin-bottom: 16px;
}

#contactModal .modal-workspace {
    display: grid;
    grid-template-columns: 560px minmax(0,1fr) auto;
    gap: 22px;
    align-items: stretch;
    min-height: 60vh;
    overflow: hidden;
}

#contactModal .modal-contact-panel,
#contactModal .modal-inspections-panel {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
}

#contactModal .modal-contact-panel {
    grid-column: 1;
    grid-row: 1;
}

#contactModal .modal-inspections-panel {
    grid-column: 2;
    grid-row: 1;
}

#contactModal .modal-workspace > * {
    min-width: 0;
}

#contactModal .modal-inspections-panel {
    min-width: 0;
}

#contactModal .modal-contact-panel {
    min-width: 0;
}

#contactModal .inspection-details-panel {
    grid-column: 3;
    grid-row: 1;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateX(12px);
    transition: width 180ms ease, opacity 180ms ease, transform 180ms ease, padding 180ms ease;
    border-left: 1px solid #e4e9ef;
    padding-left: 0;
}

#contactModal .inspection-details-panel.open {
    width: 360px;
    opacity: 1;
    transform: translateX(0);
    padding-left: 12px;
}

#contactModal .inspection-details-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#contactModal .inspection-details-body {
    display: grid;
    gap: 10px;
}

#contactModal .inspection-detail-row {
    font-size: 0.86rem;
    color: #2e3d4c;
    line-height: 1.4;
}

#contactModal .inspection-detail-row span {
    color: #4b5d6f;
}

#contactModal .inspection-detail-actions {
    margin-top: 8px;
}

#contactModal .inspection-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#contactModal .inspection-filter-toggle {
    display: inline-flex;
    gap: 6px;
}

#contactModal .inspection-filter-toggle .btn.active {
    background: #dbeafe;
    border-color: #9fc0df;
    color: #1f5f9a;
}

#contactModal .inspection-list {
    display: grid;
    gap: 8px;
}

#contactModal .inspection-row {
    display: grid;
    grid-template-columns: minmax(80px, auto) 1fr minmax(120px, auto) auto;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    background: #ffffff;
    font-size: 0.82rem;
}

#contactModal .inspection-row.selected {
    border-color: #9fc0df;
    background: #f3f8ff;
}

#contactModal .inspection-row-status {
    font-weight: 700;
    color: #2f3f50;
}

#contactModal .inspection-row-time,
#contactModal .inspection-row-contact {
    color: #5f6f80;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#contactModal .inspection-row-cta {
    justify-self: end;
    align-self: center;
    padding: 2px 10px;
    border: 1px solid #b8d0e7;
    border-radius: 999px;
    background: #edf5ff;
    color: #1f5f9a;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.3;
}

#contactModal .contact-section-title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2f3f50;
}

#contactModal .contact-list {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.contact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    background: #fdfefe;
}

.contact-row-main {
    min-width: 0;
}

.contact-row-name {
    font-weight: 700;
    color: #1f2d3a;
    margin-bottom: 2px;
}

.contact-row-meta {
    color: #617181;
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-row-actions {
    display: inline-flex;
    gap: 6px;
}

.btn-outline-primary {
    background: #ffffff;
    color: #1f5f9a;
    border: 1px solid #9fc0df;
}

#contactModal .contact-form-field .form-control {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 8px;
    background: #ffffff;
}

#contactModal .contact-form-field .form-control[readonly] {
    background: #f6f9fc;
    color: #5c6d7e;
}

#contactModal .contact-form-field {
    margin-bottom: 0;
}

#contactModal .contact-form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5d6f;
    letter-spacing: 0.01em;
}

#contactModal .contact-form-panel {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #e9eef5;
    border-radius: 12px;
    background: #f7f9fc;
}

#contactModal .contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 14px;
}

#contactModal .contact-form-half {
    grid-column: span 1;
}

#contactModal .contact-form-full {
    grid-column: 1 / -1;
}

#contactModal .contact-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

#contactModal .contact-form-actions .btn-primary {
    min-width: 132px;
}


#saveContactBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.helper-text-muted {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #7b8794;
}

.comments-textarea {
    min-height: 120px;
    resize: vertical;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.phase-box input[type="text"]:focus,
.phase-box input[type="email"]:focus,
.phase-box input[type="tel"]:focus,
.phase-box input[type="date"]:focus,
.phase-box select:focus,
.phase-box textarea:focus,
#contactModal .contact-form-field .form-control:focus,
.comments-textarea:focus {
    outline: none;
    border-color: #7fb1e1;
    background-color: #fafdff;
    box-shadow: 0 0 0 3px rgba(54, 127, 197, 0.16);
}

.admin-table-container {
    width: 100%;
}

.summary-unassigned-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #efc2c2;
    border-radius: 6px;
    background: #fff1f1;
    color: #8a2a2a;
    font-weight: 600;
}

.admin-table tr.summary-unassigned-row td {
    background-color: #fff1f1 !important;
}

.project-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-search-row .form-control {
    flex: 1 1 auto;
}

.project-search-row .btn {
    flex: 0 0 auto;
    min-width: 92px;
}

.project-search-status {
    min-height: 1.2em;
}

.project-email-verify-box {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #f7fbff;
}

.project-email-verify-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.project-email-verify-row .form-control {
    flex: 1 1 auto;
}

.project-email-verify-status {
    min-height: 1.2em;
}

.project-suggestions {
    margin-top: 6px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
}

.project-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid #eef2f6;
    padding: 10px 12px;
    font-weight: 500;
    color: #1f2d3a;
    cursor: pointer;
}

.project-suggestion-item:last-child {
    border-bottom: 0;
}

.project-suggestion-item:hover,
.project-suggestion-item.active {
    background: #eef4ff;
}

.admin-table tr.desktop-active-row td {
    background-color: #f3f8ff !important;
}

.summary-route-planner {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.summary-route-card {
    border: 1px solid #d7dee8;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.summary-route-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.summary-route-head h4 {
    margin: 0;
}

.summary-route-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.summary-route-status {
    min-height: 1.2em;
    margin: 6px 0;
}

.summary-route-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.summary-route-item {
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f9fbff;
    padding: 8px;
    cursor: move;
    display: grid;
    grid-template-columns: 160px 140px 1fr;
    gap: 10px;
    align-items: center;
}

.summary-route-item-controls {
    display: none;
}

.summary-route-item.active {
    border-color: #0d6efd;
    background: #eef4ff;
}

.summary-route-item.summary-route-dragging {
    opacity: 0.55;
}

.summary-route-time {
    font-weight: 600;
}

.summary-route-job {
    font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 720px) {
    .project-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .project-search-row .btn {
        width: 100%;
    }

    .project-email-verify-row {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-route-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .summary-route-item-controls {
        display: flex;
        gap: 6px;
        margin-top: 4px;
    }

    .summary-route-item-controls .btn-smooth {
        padding: 4px 10px;
        min-height: 34px;
    }
}

/* Verification section polish (localized) */
#projectEmailVerificationBox .helper-text-muted {
    margin-top: 0;
}

.project-email-verify-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

#projectEmailCodeInput.project-email-code-input {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

#sendProjectEmailCodeBtn {
    grid-column: 1;
    grid-row: 2;
}

#verifyProjectEmailCodeBtn {
    grid-column: 3;
    grid-row: 2;
}

.project-email-verify-status {
    margin-top: 8px;
}

@media (max-width: 720px) {
    .project-email-verify-row {
        grid-template-columns: 1fr;
    }

    #projectEmailCodeInput.project-email-code-input {
        grid-column: 1;
        grid-row: 1;
    }

    #sendProjectEmailCodeBtn,
    #verifyProjectEmailCodeBtn {
        grid-column: 1;
        width: 100%;
    }

    #sendProjectEmailCodeBtn {
        grid-row: 2;
    }

    #verifyProjectEmailCodeBtn {
        grid-row: 3;
    }
}

@media (max-width: 1000px) {

.table-responsive-mobile {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    min-width: 600px;
}

}

@media (max-width: 1000px) {

form .row {
    display: block;
}

form .row > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    margin-bottom: 12px;
}

form input,
form select,
form textarea {
    width: 100%;
    max-width: 100%;
}

.contact-form-grid,
.project-search-row,
.project-email-verify-row {
    display: block;
    width: 100%;
}

}

@media (max-width: 1000px) {

/* Larger tap targets */
.btn {
    min-height: 44px;
    padding: 10px 14px;
}

/* Stack button groups vertically */
.btn-group,
.form-actions,
.contact-form-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ensure modals fit inside phone screen */
.modal-dialog {
    margin: 8px;
    max-width: calc(100% - 16px);
}

.modal-content {
    max-height: 95vh;
    overflow-y: auto;
}

/* Improve readable spacing */
label {
    margin-top: 6px;
}

.form-group,
.mb-3 {
    margin-bottom: 14px;
}

}

body.mobile-mode {

font-size: 16px;

}

body.mobile-mode h1,
body.mobile-mode h2,
body.mobile-mode h3 {
line-height: 1.2;
}

body.mobile-mode .admin-page-container,
body.mobile-mode .page-container {
padding-left: 10px;
padding-right: 10px;
}

body.mobile-mode .mobile-inspector-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: white;
border-top: 1px solid #ddd;
padding: 8px;
display: flex;
gap: 8px;
z-index: 9999;
}

body.mobile-mode .mobile-inspector-bar .btn {
flex: 1;
}

body.mobile-mode {
padding-bottom: 80px;
}

body.mobile-mode .mobile-today-panel {
background:#fff;
border:1px solid #ddd;
padding:10px;
margin-bottom:10px;
}

body.mobile-mode #mobileTodayList {
display:flex;
flex-direction:column;
gap:6px;
}

body.mobile-mode #mobileRouteBtn {
width:100%;
margin-bottom:8px;
}

body:not(.inspector-mode) .mobile-inspector-bar,
body:not(.inspector-mode) .mobile-today-panel {
display:none !important;
}

@media (max-width:1000px){

  body.mobile-mode #contactModal{
    position:fixed !important;
    inset:0 !important;
    height:100vh !important;
    width:100vw !important;
    align-items:flex-start !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch;
    padding:8px !important;
  }

  body.mobile-mode #contactModal .kor-modal-content{
    width:100% !important;
    max-width:100% !important;
    min-height:0 !important;
    max-height:none !important;
    overflow:visible !important;
    box-sizing:border-box !important;
    margin:0 !important;
  }

  body.mobile-mode #contactModal .modal-workspace{
    grid-template-columns:1fr !important;
    min-height:0 !important;
    overflow:visible !important;
  }

  body.mobile-mode #contactModal .modal-contact-panel,
  body.mobile-mode #contactModal .modal-inspections-panel,
  body.mobile-mode #contactModal .inspection-details-panel{
    grid-column:1 !important;
    grid-row:auto !important;
    overflow:visible !important;
    max-height:none !important;
  }

  body.mobile-mode #contactModal .inspection-details-panel.open{
    width:100% !important;
    max-width:100% !important;
    padding-left:0 !important;
  }
}

@media (max-width:1000px){
  body.mobile-mode.inspector-mode #adminMobileTodayPanel{
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,0.06);
  }

  body.mobile-mode.inspector-mode #adminMobileTodayPanel h3{
    margin:0 0 8px 0;
    font-size:1rem;
  }

  body.mobile-mode.inspector-mode #mobileTodayList{
    max-height:34vh;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    padding-right:2px;
  }

  body.mobile-mode.inspector-mode .mobile-today-item-btn{
    text-align:left;
    white-space:normal;
    line-height:1.25;
    font-size:.9rem;
    border-radius:8px;
  }

  body.mobile-mode.inspector-mode .mobile-today-item-btn.active{
    color:#fff;
    background:#0d6efd;
    border-color:#0d6efd;
  }

  body.mobile-mode.inspector-mode tr.mobile-active-row{
    outline:2px solid #0d6efd;
    outline-offset:-2px;
    background:#f3f8ff;
  }

  body.mobile-mode.inspector-mode #adminMobileInspectorBar{
    box-shadow:0 -3px 10px rgba(0,0,0,0.08);
  }

  body.mobile-mode.inspector-mode #adminMobileInspectorBar .btn[aria-disabled="true"]{
    opacity:.55;
    pointer-events:none;
  }
}

/* Inspections table */
#inspectionsTable {
    width: 100%;
    border-collapse: collapse;
}

#inspectionsTable th,
#inspectionsTable td {
    text-align: left;
    padding: 6px 12px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

#inspectionsTable thead tr {
    border-bottom: 2px solid #adb5bd;
}
