[x-cloak] { display: none !important; }

/* Tabulator theme overrides */
.tabulator {
    border: 1px solid #d4dff0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}
.tabulator .tabulator-header {
    background-color: #0C419a !important;
    color: #ffffff !important;
    border-bottom: 2px solid #082d6b !important;
    font-weight: 600;
}
.tabulator .tabulator-header .tabulator-col {
    background-color: #0C419a !important;
    border-right-color: rgba(255, 255, 255, 0.15) !important;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background-color: #1a5abf !important;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
    color: #ffffff !important;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    color: #ffffff !important;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row {
    border-bottom: 1px solid #eef2f7;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row:hover {
    background-color: #f0f5ff;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-row.tabulator-row-even {
    background-color: #f8fafc;
}
.tabulator .tabulator-footer {
    background-color: #f7f9fc;
    border-top: 1px solid #d4dff0;
}
.tabulator .tabulator-footer .tabulator-page.active {
    background-color: #0C419a;
    color: #fff;
    border-color: #0C419a;
}

/* Tabulator group rows */
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-group {
    background-color: #eef3fb;
    border-bottom: 2px solid #0C419a;
    border-top: 1px solid #d4e0f7;
    font-weight: 700;
    cursor: pointer;
    color: #0C419a;
}
.tabulator .tabulator-tableHolder .tabulator-table .tabulator-group:hover {
    background-color: #ddeafb;
}

/* ── Invoice Preview Popup ──────────────────────────────────── */
.invoice-preview-swal {
    padding: 0 !important;
    overflow: hidden !important;
}
.invoice-preview-swal .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}
.invoice-preview-swal .swal2-close {
    color: rgba(255, 255, 255, 0.85) !important;
    top: 14px !important;
    right: 14px !important;
    font-size: 1.5rem !important;
    z-index: 10 !important;
}

/* Monthly summary rows */
.tabulator .tabulator-row.monthly-summary td {
    background-color: #fef3c7;
    font-weight: 700;
    border-top: 2px solid #0C419a;
    border-bottom: 2px solid #0C419a;
}

/* Schedule-X overrides */
.sx__calendar-wrapper {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #bce8f1;
}

/* SweetAlert2 overrides */
.swal2-popup {
    border-radius: 0.75rem !important;
    font-family: inherit !important;
}
.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
}
.swal2-confirm {
    border-radius: 0.5rem !important;
}
.swal2-cancel {
    border-radius: 0.5rem !important;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.mms-spinner {
    animation: spin 1s linear infinite;
}

/* Speech-to-text mic button pulse while recording */
@keyframes mmsSttPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* Splash screen animations */
@keyframes mmsPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(59,130,246,0); }
}
@keyframes mmsBounce {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}
@keyframes mmsDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Print styles */
@media print {
    #app-nav, #app-bottom-nav { display: none !important; }
    main { padding: 0 !important; }
}

/* Litepicker overrides */
.litepicker .container__months .month-item-header {
    font-weight: 600;
}
.litepicker .container__days .day-item.is-today {
    color: #0C419a;
    font-weight: 700;
}
.litepicker .container__days .day-item.is-start-date,
.litepicker .container__days .day-item.is-end-date {
    background-color: #0C419a;
}

/* Bottom-right "More" popup menu */
.mms-more-menu {
    position: fixed;
    bottom: 3.75rem;
    right: 0.5rem;
    z-index: 60;
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
    border: 1px solid #bce8f1;
}

/* Hide IP column on mobile portrait */
@media (max-width: 640px) and (orientation: portrait) {
    .hide-portrait { display: none !important; }
}

/* Safe area for bottom nav */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ── Jobs Table View (calendar.html) ─────────────────────────────────── */

/* Hide the calendar controls bar when the table view is active */
#cal-controls-wrapper.hidden-in-table { display: none !important; }

/* ── Jobs table search bar ──────────────────────────────────────────── */
.jobs-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
#btn-calendar-view {
    background: #0C419a;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.7rem;
    border-radius: 0.375rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
#btn-calendar-view:hover { background: #093175; }
#jobs-search-input {
    flex: 1;
    border: 1.5px solid #bce8f1;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}
#jobs-search-input:focus { border-color: #0C419a; }
.jobs-search-count {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    min-width: 4rem;
    text-align: right;
}

#jobs-table-view { display: none; }

.jobs-month-group {
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}
.jobs-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background: #0C419a;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.jobs-month-header:hover { background: #093175; }
.jobs-month-header .chevron { transition: transform 0.2s; font-size: 0.65rem; }
.jobs-month-header.open .chevron { transform: rotate(180deg); }
.jobs-month-count { opacity: 0.75; font-weight: 400; font-size: 0.75rem; }

.jobs-month-body { display: none; }
.jobs-month-body.open { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.jobs-table-el { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.jobs-table-el thead tr { background: #f8fafc; }
.jobs-table-el th {
    padding: 0.45rem 0.6rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}
.jobs-table-el td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.jobs-table-el tbody tr { cursor: pointer; transition: background 0.1s; }
.jobs-table-el tbody tr:hover { background: #eff6ff; }
.jobs-table-el tbody tr:last-child td { border-bottom: none; }
.jobs-table-el .col-date  { white-space: nowrap; }
.jobs-table-el .col-route { white-space: nowrap; }
.jobs-table-el .col-team  { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ── PLANNING BRANCH: extra top offset for the red danger banner ──────── */
/* The banner is 32px tall and sits at top-14 (56px). Main content must    */
/* clear both the nav (56px) and the banner (32px) = 88px total.           */
main { padding-top: 5.5rem !important; }
