:root {
    --fieldops-sidebar: 176px;
    --fieldops-blue: #0b5ed7;
    --fieldops-border: #dee2e6;
    --fieldops-muted: #6c757d;
}

body {
    background: #f8f9fa;
    color: #101828;
    font-size: 14px;
    margin: 0;
    overflow-x: hidden;
}

.skip-link {
    background: #fff;
    border: 2px solid var(--fieldops-blue);
    border-radius: 6px;
    color: #0b5ed7;
    font-weight: 700;
    left: .75rem;
    padding: .5rem .75rem;
    position: fixed;
    top: .75rem;
    transform: translateY(-160%);
    transition: transform .15s ease;
    z-index: 2000;
}

.skip-link:focus {
    outline: 3px solid rgba(11, 94, 215, .3);
    outline-offset: 2px;
    transform: translateY(0);
}

.visually-hidden {
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    background: #f1f3f5;
    border-right: 1px solid var(--fieldops-border);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    position: fixed;
    top: 0;
    width: var(--fieldops-sidebar);
    z-index: 1020;
}

.app-brand {
    align-items: center;
    border-bottom: 1px solid var(--fieldops-border);
    display: flex;
    gap: .65rem;
    min-height: 54px;
    padding: .75rem 1rem;
}

.brand-mark {
    align-items: center;
    background: var(--fieldops-blue);
    border-radius: 6px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.brand-mark-sm {
    height: 24px;
    width: 24px;
}

.mobile-top-brand {
    align-items: center;
    display: inline-flex;
    gap: .5rem;
}

.mobile-nav-toggle {
    white-space: nowrap;
}

.sidebar-section {
    color: var(--fieldops-muted);
    font-size: .72rem;
    padding: 1rem 1rem .35rem;
}

.sidebar-link {
    align-items: center;
    border-radius: 6px;
    color: #212529;
    display: flex;
    gap: .55rem;
    margin: .1rem .55rem;
    padding: .42rem .55rem;
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #dee2e6;
    color: #000;
}

.app-main {
    margin-left: var(--fieldops-sidebar);
    min-height: 100vh;
    overflow-x: hidden;
}

.demo-bar {
    align-items: center;
    background: #fff8e6;
    border-bottom: 1px solid #efc65f;
    display: flex;
    gap: 1rem;
    justify-content: center;
    min-height: 34px;
    padding: .25rem .75rem;
}

.top-actions {
    background: #fff;
    border-bottom: 1px solid var(--fieldops-border);
    min-height: 46px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.content-wrap {
    min-width: 0;
    overflow-x: hidden;
    padding: 1.25rem;
}

.content-wrap .row {
    margin-left: 0;
    margin-right: 0;
}

.pwa-status-pill {
    background: #e9f7ef;
    border: 1px solid #badbcc;
    border-radius: 999px;
    color: #0f5132;
    font-size: .74rem;
    padding: .15rem .5rem;
}

.ops-card {
    border: 1px solid var(--fieldops-border);
    border-radius: 8px;
    box-shadow: none;
}

.metric-card {
    min-height: 108px;
}

.platform-nav-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.platform-nav-card {
    background: #fff;
    color: #212529;
    display: flex;
    gap: .75rem;
    min-height: 88px;
    padding: .85rem;
    text-decoration: none;
}

.platform-nav-card:hover,
.platform-nav-card:focus {
    border-color: #0b5ed7;
    box-shadow: 0 0 0 .15rem rgba(11, 94, 215, .12);
    color: #0b5ed7;
}

.platform-section {
    scroll-margin-top: 1rem;
}

.icon-tile {
    align-items: center;
    background: #e9ecef;
    border-radius: 6px;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.avatar-pill {
    align-items: center;
    background: #e7f1ff;
    border: 1px solid #bfd7ff;
    border-radius: 999px;
    color: var(--fieldops-blue);
    display: inline-flex;
    font-weight: 700;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.status-badge {
    border-radius: 5px;
    font-size: .72rem;
    padding: .2rem .45rem;
}

.drop-zone {
    align-items: center;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 150px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.job-progress {
    height: .65rem;
}

.job-timeline {
    display: grid;
    gap: 1rem;
}

.job-timeline-item {
    display: grid;
    gap: .75rem;
    grid-template-columns: 28px 1fr;
}

.job-timeline-icon {
    align-items: flex-start;
    display: flex;
    justify-content: center;
    padding-top: .1rem;
}

.pricing-matrix-scroll {
    contain: layout paint;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    width: 100%;
}

.pricing-matrix-card {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.pricing-matrix-card .card-body {
    max-width: 100%;
    min-width: 0;
}

.pricing-matrix-card .pricing-matrix-scroll {
    max-width: min(100%, calc(100vw - var(--fieldops-sidebar) - 3rem));
}

.pricing-matrix-table {
    min-width: 1540px;
}

.schedule-workspace {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(700px, 1fr) minmax(300px, 330px);
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.schedule-main,
.schedule-side-panel {
    min-width: 0;
}

.schedule-booking-card {
    max-width: 100%;
}

.schedule-booking-card .form-label {
    font-size: .86rem;
    margin-bottom: .28rem;
}

.schedule-booking-card .mb-3 {
    margin-bottom: .85rem !important;
}

.schedule-composer-toolbar {
    align-items: center;
    border-bottom: 1px solid var(--fieldops-border);
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    margin: -1rem -1rem .85rem;
    min-height: 58px;
    padding: .75rem 1rem;
}

.schedule-composer-meta {
    align-items: flex-start;
    border-bottom: 1px solid var(--fieldops-border);
    display: grid;
    gap: .45rem;
    margin: 0 -1rem .9rem;
    padding: 0 1rem .85rem;
}

.schedule-selected-slot {
    color: var(--fieldops-muted);
    font-size: .82rem;
    line-height: 1.35;
}

.schedule-scroll {
    overflow-x: auto;
}

.schedule-calendar {
    display: grid;
    grid-template-columns: 68px repeat(7, minmax(136px, 1fr));
    min-width: 1020px;
}

.schedule-corner,
.schedule-day-head,
.schedule-time,
.schedule-slot {
    border-bottom: 1px solid var(--fieldops-border);
    border-right: 1px solid var(--fieldops-border);
}

.schedule-corner,
.schedule-day-head {
    background: #fff;
    min-height: 74px;
    padding: .65rem;
}

.schedule-day-head.is-today {
    background: #e7f1ff;
    color: #0b5ed7;
}

.schedule-time {
    background: #f8f9fa;
    color: var(--fieldops-muted);
    font-size: .78rem;
    padding: .55rem;
}

.schedule-slot {
    background: #fff;
    cursor: pointer;
    min-height: 104px;
    padding: .35rem;
    position: relative;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.schedule-slot:hover,
.schedule-slot:focus {
    background: #f5f9ff;
    box-shadow: inset 0 0 0 2px rgba(11, 94, 215, .2);
    outline: 0;
}

.schedule-slot.is-selected {
    background: #e7f1ff;
    box-shadow: inset 0 0 0 2px #0b5ed7;
}

.schedule-slot-hint {
    align-items: center;
    background: #fff;
    border: 1px solid #bfd7ff;
    border-radius: 6px;
    bottom: .35rem;
    color: #0b5ed7;
    display: inline-flex;
    font-size: .76rem;
    gap: .25rem;
    opacity: 0;
    padding: .15rem .4rem;
    pointer-events: none;
    position: absolute;
    right: .35rem;
    transition: opacity .15s ease;
}

.schedule-slot:hover .schedule-slot-hint,
.schedule-slot:focus .schedule-slot-hint,
.schedule-slot.is-selected .schedule-slot-hint {
    opacity: 1;
}

.schedule-slot.has-events .schedule-slot-hint {
    bottom: auto;
    margin-top: .1rem;
    position: static;
    right: auto;
}

.schedule-event {
    border-left: 4px solid #0b5ed7;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    font-size: .78rem;
    margin-bottom: .35rem;
    padding: .45rem;
}

.schedule-event.event-job {
    background: #e7f1ff;
    border-left-color: #0b5ed7;
}

.schedule-event.event-appointment {
    background: #e9f7ef;
    border-left-color: #198754;
}

.schedule-event.event-meeting {
    background: #fff3cd;
    border-left-color: #ffc107;
}

.schedule-event.event-reminder {
    background: #f1f3f5;
    border-left-color: #6c757d;
}

@media (min-width: 992px) {
    .schedule-side-panel {
        align-self: start;
        position: sticky;
        top: 0;
    }

    .schedule-booking-card .card-body {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

@media (min-width: 1400px) {
    .schedule-workspace {
        grid-template-columns: minmax(700px, 1fr) 340px;
    }
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 0;
}

.btn,
.badge,
.form-control,
.form-select {
    max-width: 100%;
}

.btn {
    align-items: center;
    display: inline-flex;
    gap: .35rem;
    justify-content: center;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        box-shadow: 0 0 28px rgba(16, 24, 40, .18);
        max-width: 320px;
        position: fixed;
        transform: translateX(-105%);
        transition: transform .18s ease;
        width: min(86vw, 320px);
        will-change: transform;
        z-index: 1045;
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .mobile-nav-open {
        overflow: hidden;
    }

    .app-sidebar-backdrop {
        background: rgba(16, 24, 40, .45);
        bottom: 0;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 1040;
    }

    .app-main {
        margin-left: 0;
    }

    .sidebar-link {
        display: flex;
        min-height: 42px;
    }

    .demo-bar {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .content-wrap {
        padding: .85rem;
    }

    .content-wrap > .d-flex,
    .content-wrap > form .row,
    .content-wrap .card-header,
    .content-wrap .btn-toolbar {
        gap: .5rem;
    }

    .content-wrap .card {
        max-width: 100%;
    }

    .content-wrap .table {
        min-width: 680px;
    }

    .schedule-calendar {
        grid-template-columns: 62px repeat(7, minmax(122px, 1fr));
        min-width: 920px;
    }

    .schedule-slot {
        min-height: 92px;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 13px;
    }

    .page-title {
        font-size: 1.12rem;
    }

    .content-wrap {
        padding: .7rem;
    }

    .demo-bar {
        gap: .5rem;
    }

    .top-actions {
        min-height: 52px;
    }

    .content-wrap .row > * {
        padding-left: .25rem;
        padding-right: .25rem;
    }

    .metric-card {
        min-height: 86px;
    }

    .platform-nav-grid {
        grid-template-columns: 1fr;
    }

    .pricing-matrix-table {
        min-width: 980px;
    }

    .pricing-matrix-card .pricing-matrix-scroll {
        max-width: calc(100vw - 1.4rem);
    }

    .schedule-corner,
    .schedule-day-head {
        min-height: 66px;
        padding: .45rem;
    }

    .schedule-time {
        padding: .45rem;
    }

    .schedule-slot {
        min-height: 84px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 42px;
    }
}
