/**
 * Phase 41.0 — Mobile usability + field worker simple mode
 */

/* ── Field worker shell ─────────────────────────────────────────── */
.field-worker-mode.mobile-mode .main-sidebar {
    display: none;
}

.field-worker-on-field-route.mobile-mode .fo-field-shell {
    min-height: calc(100dvh - 48px);
}

.field-worker-on-field-route.mobile-mode .fo-field-tabbar {
    bottom: 0;
}

.field-worker-on-field-route.mobile-mode .content-area {
    padding-bottom: 0 !important;
}

.field-worker-mode.mobile-mode .content-area {
    padding: 0.5rem !important;
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0)) !important;
}

.field-worker-mode .fo-field-shell--simple .fo-field-main {
    padding: 0.65rem;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ── Compact cards / density ───────────────────────────────────── */
.fo-field-assignment-list--compact {
    gap: 0.5rem;
}

.fo-field-section-title--compact {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.95rem;
}

.fo-field-shell--simple .fo-card,
.fo-field-shell--simple .fo-field-assignment {
    padding: 0.75rem;
}

.fo-field-shell--simple .fo-field-title {
    font-size: 1.15rem;
}

/* ── Home clock card ───────────────────────────────────────────── */
.fo-field-home-clock-card {
    background: var(--fo-card, #1e293b);
    border: 1px solid var(--fo-border, rgba(255,255,255,0.08));
    border-radius: var(--fo-radius-lg, 12px);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.fo-field-home-clock-card--in {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}

.fo-field-home-clock-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.fo-field-home-clock-buttons {
    display: grid;
    gap: 0.5rem;
}

.fo-field-home-active-job {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

/* ── Thumb-friendly buttons ─────────────────────────────────────── */
.fo-field-btn-xxl {
    min-height: 56px;
    width: 100%;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fo-field-clock-actions--stacked {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fo-field-clock-break-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.fo-field-btn-lg {
    min-height: 48px;
    font-weight: 600;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.fo-field-empty--compact {
    padding: 1rem 0.5rem;
}

.fo-field-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.fo-field-empty-upcoming {
    font-size: 0.8rem;
    color: var(--fo-text-tertiary, #94a3b8);
    text-align: center;
}

/* ── Phase 56A.1 field home polish ─────────────────────────────── */
.fo-daily-workspace--field-home {
    gap: 0.75rem;
    max-width: 100%;
    overflow-x: hidden;
}

.fo-field-progress-strip {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--fo-card, #1e293b);
    border: 1px solid var(--fo-border, rgba(255,255,255,0.08));
}

.fo-field-progress-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3rem;
}

.fo-field-progress-stat strong {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
}

.fo-field-progress-stat span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fo-text-tertiary, #94a3b8);
}

.fo-field-progress-bar-wrap {
    min-width: 0;
}

.fo-field-progress-wo {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--fo-text-tertiary, #94a3b8);
}

.fo-field-home-clock-card--compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0.65rem 0.75rem;
}

.fo-field-home-clock-card--compact .fo-field-home-clock-status {
    margin-bottom: 0;
}

.fo-field-hero-job {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 100%;
}

.fo-field-hero-job--active {
    border-color: rgba(34, 197, 94, 0.45);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(30, 41, 59, 0.95));
}

.fo-field-hero-job-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fo-field-hero-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #93c5fd;
}

.fo-field-hero-title {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    padding: 0.15rem 0;
    word-break: break-word;
}

.fo-field-hero-meta {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.35;
    color: #e2e8f0;
}

.fo-field-hero-meta i {
    margin-right: 0.25rem;
    opacity: 0.85;
}

.fo-field-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.25rem 0 0.35rem;
}

.fo-field-hero-task-progress {
    margin: 0.35rem 0 0.5rem;
}

.fo-field-workflow-cta {
    margin: 0.35rem 0 0.25rem;
}

.fo-field-workflow-hint {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    text-align: center;
    color: var(--fo-text-tertiary, #94a3b8);
}

.fo-field-btn-hero {
    min-height: 64px;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.fo-btn--success,
.fo-field-btn-hero.fo-btn--success {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.fo-field-hero-actions {
    margin-top: 0.35rem;
}

.fo-field-schedule-group-label {
    margin: 0.85rem 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fo-field-schedule-group-label:first-of-type {
    margin-top: 0;
}

.fo-field-schedule-group-label--current {
    color: #4ade80;
}

.fo-field-schedule-group-label--upcoming {
    color: #93c5fd;
}

.fo-field-schedule-group-label--done {
    color: #94a3b8;
}

.fo-field-assignment--current {
    border-color: rgba(34, 197, 94, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.fo-field-assignment-list--upcoming .fo-field-assignment,
.fo-field-assignment--upcoming {
    opacity: 0.92;
}

.fo-field-assignment-list--done .fo-field-assignment,
.fo-field-assignment--done {
    opacity: 0.55;
    filter: grayscale(0.25);
}

.fo-field-assignment-list--done .fo-field-assignment-title {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

/* ── Quick actions grid ─────────────────────────────────────────── */
.fo-field-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fo-field-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 72px;
    padding: 0.55rem 0.35rem;
    border-radius: 10px;
    background: var(--fo-card, #1e293b);
    border: 1px solid var(--fo-border, rgba(255,255,255,0.08));
    color: inherit;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

.fo-field-action-btn i {
    font-size: 1.25rem;
}

.fo-field-action-btn--primary {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

/* ── Crew panel ─────────────────────────────────────────────────── */
.fo-field-crew-panel {
    margin-bottom: 0.75rem;
}

.fo-field-crew-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.fo-field-crew-foreman {
    font-size: 0.78rem;
    opacity: 0.85;
}

.fo-field-crew-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.fo-field-crew-member {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.fo-field-crew-member:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fo-field-crew-member-main {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.fo-field-crew-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
    flex-shrink: 0;
}

.fo-field-crew-status--in {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.fo-field-crew-job {
    margin-left: 1.35rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.fo-field-crew-job--in {
    color: #86efac;
}

.fo-field-crew-lead {
    margin-left: 0.35rem;
    font-size: 0.65rem;
}

.fo-field-scope-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

/* ── Field worker mobile nav ────────────────────────────────────── */
.mobile-nav-bar--field .mobile-nav-item {
    min-height: 48px;
    font-size: 0.65rem;
}

/* ── Global mobile density (office users) ───────────────────────── */
@media (max-width: 768px) {
    .fieldops-shell.mobile-mode .fo-page-header {
        padding: 0.65rem 0.75rem;
    }

    .fieldops-shell.mobile-mode .fo-page-body {
        padding: 0.65rem !important;
    }

    .fieldops-shell.mobile-mode .fo-card {
        padding: 0.75rem;
        margin-bottom: 0.65rem;
    }

    .fieldops-shell.mobile-mode .table-responsive,
    .fieldops-shell.mobile-mode .fo-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .fieldops-shell.mobile-mode table.table {
        min-width: 0;
        font-size: 0.82rem;
    }

    .fieldops-shell.mobile-mode .btn,
    .fieldops-shell.mobile-mode .fo-btn {
        min-height: 44px;
    }

    .fieldops-shell.mobile-mode .row {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .fieldops-shell.mobile-mode .container,
    .fieldops-shell.mobile-mode .container-fluid {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .fo-field-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fo-field-btn-xxl {
        min-height: 52px;
        font-size: 1rem;
    }

    .fo-field-btn-hero {
        min-height: 60px;
        font-size: 1.08rem;
    }

    .fo-field-progress-strip {
        grid-template-columns: 1fr 1fr;
    }

    .fo-field-progress-bar-wrap {
        grid-column: 1 / -1;
    }

    .fo-field-hero-title {
        font-size: 1.2rem;
    }
}
