/**
 * Sales Command Center — Phase 5B
 */

.fo-sales-shell {
    display: flex;
    flex-direction: column;
    gap: var(--fo-space-md);
    min-height: 0;
}

.fo-sales-header-main {
    display: flex;
    gap: var(--fo-space-md);
    align-items: flex-start;
}

.fo-sales-header-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--fo-radius-lg, 12px);
    background: var(--fo-primary, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.fo-sales-title {
    margin: 0;
    font-size: var(--fo-font-xl, 1.35rem);
    font-weight: 700;
}

.fo-sales-subtitle {
    margin: 0;
    opacity: 0.75;
    font-size: var(--fo-font-sm);
}

.fo-sales-header-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: var(--fo-font-sm);
    margin-top: 0.5rem;
}

.fo-sales-copilot {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--fo-radius-md, 8px);
    background: rgba(59, 130, 246, 0.08);
    font-size: var(--fo-font-sm);
}

.fo-sales-pinned {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.fo-sales-tabbar {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--fo-border, rgba(255,255,255,0.1));
    overflow-x: auto;
}

.fo-sales-tabbar--mobile {
    position: sticky;
    bottom: 0;
    background: var(--fo-surface, #111);
    padding: 0.5rem;
    z-index: 20;
    border-top: 1px solid var(--fo-border, rgba(255,255,255,0.1));
    border-bottom: none;
}

.fo-sales-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    font-size: 0.72rem;
    white-space: nowrap;
    cursor: pointer;
}

.fo-sales-tab--active {
    opacity: 1;
    color: var(--fo-primary, #3b82f6);
    border-bottom: 2px solid var(--fo-primary, #3b82f6);
}

.fo-sales-main {
    min-height: 320px;
}

.fo-sales-embedded-panel {
    padding: 0.25rem 0;
}

.fo-sales-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fo-sales-card {
    padding: 1rem;
    border-radius: var(--fo-radius-md, 8px);
    border: 1px solid var(--fo-border, rgba(255,255,255,0.12));
    cursor: pointer;
}

.fo-sales-estimate-table {
    /* Single scroll owner: page/shell — avoid nested max-height clipping with Virtualize. */
    overflow: visible;
}

.fo-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--fo-border, rgba(0,0,0,0.12));
    background: transparent;
    color: inherit;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    cursor: pointer;
}

.fo-filter-chip__count {
    font-weight: 600;
    opacity: 0.85;
}

.fo-filter-chip--active {
    border-color: var(--fo-accent, #0d6efd);
    background: color-mix(in srgb, var(--fo-accent, #0d6efd) 12%, transparent);
    color: var(--fo-accent, #0d6efd);
}

.fo-approval-metrics {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--fo-border, rgba(0,0,0,0.08));
}

/* fo-kpi-card--active defined in fieldops-design-system.css */

.fo-scroll-x {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.fo-mobile-more-menu {
    position: fixed;
    bottom: 4.5rem;
    right: 1rem;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--fo-radius-md, 8px);
    background: var(--fo-surface-elevated, #1a1a1a);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.fo-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
}

.fo-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100vw);
    z-index: 1050;
    background: var(--fo-surface-elevated, #1a1a1a);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}

.fo-drawer--wide {
    width: min(560px, 100vw);
}

.fo-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--fo-border, rgba(255,255,255,0.1));
}

.fo-drawer-title {
    margin: 0;
    font-size: 1.1rem;
}

.fo-drawer-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.fo-sales-shell--mobile .fo-sales-header-metrics {
    display: none;
}

.fo-badge--success { background: #198754; color: #fff; }
.fo-badge--danger { background: #dc3545; color: #fff; }
.fo-badge--warn { background: #ffc107; color: #000; }
