/**
 * Customer Command Center — Phase 4B
 */

.fo-customer-shell {
    display: flex;
    flex-direction: column;
    gap: var(--fo-space-md);
    min-height: 0;
}

.fo-customer-shell--mobile .fo-customer-header-contact {
    display: none;
}

.fo-customer-header {
    display: flex;
    flex-direction: column;
    gap: var(--fo-space-md);
}

.fo-customer-header-main {
    display: flex;
    gap: var(--fo-space-md);
    align-items: flex-start;
}

.fo-customer-avatar {
    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;
    font-weight: 700;
    flex-shrink: 0;
}

.fo-customer-name {
    font-size: var(--fo-font-xl, 1.35rem);
    margin: 0;
    font-weight: 700;
}

.fo-customer-header-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.fo-customer-header-meta,
.fo-customer-header-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: var(--fo-font-sm);
    opacity: 0.85;
    margin-top: 0.35rem;
}

.fo-customer-contact-link {
    color: inherit;
    text-decoration: none;
}

.fo-customer-quick-actions {
    flex-wrap: wrap;
}

.fo-customer-pinned {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.fo-customer-tabbar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--fo-border, rgba(255,255,255,0.08));
}

.fo-customer-tabbar--mobile {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--fo-card, #1e293b);
    border-top: 1px solid var(--fo-border);
    border-bottom: none;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.fo-customer-shell--mobile .fo-customer-main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.fo-customer-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--fo-text-secondary, #94a3b8);
    font-size: var(--fo-font-sm);
    font-weight: 600;
    border-radius: var(--fo-radius-md);
    white-space: nowrap;
    cursor: pointer;
}

.fo-customer-tab--active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--fo-primary, #3b82f6);
}

.fo-customer-tabbar--mobile .fo-customer-tab {
    flex: 1;
    flex-direction: column;
    font-size: 0.65rem;
    min-height: 52px;
    justify-content: center;
}

.fo-customer-more-menu {
    position: fixed;
    bottom: calc(64px + env(safe-area-inset-bottom));
    right: 1rem;
    background: var(--fo-card);
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-md);
    padding: 0.5rem;
    z-index: 101;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
}

.fo-customer-more-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    border-radius: var(--fo-radius-sm);
    cursor: pointer;
}

.fo-customer-main {
    flex: 1;
    min-height: 0;
}

.fo-customer-muted {
    color: var(--fo-text-tertiary, #94a3b8);
    font-size: var(--fo-font-sm);
    margin: 0.25rem 0 0;
}

.fo-customer-split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--fo-space-lg);
    align-items: start;
}

@media (max-width: 960px) {
    .fo-customer-split {
        grid-template-columns: 1fr;
    }
    .fo-customer-split-detail {
        order: -1;
    }
}

.fo-customer-split-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.fo-customer-list-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-md);
    background: var(--fo-card);
    color: inherit;
    cursor: pointer;
}

.fo-customer-list-row--static {
    cursor: default;
}

.fo-customer-list-row:hover:not(.fo-customer-list-row--static) {
    border-color: var(--fo-primary);
}

.fo-customer-section-label {
    font-size: var(--fo-font-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
    margin: 1rem 0 0.25rem;
}

.fo-customer-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--fo-space-md);
}

.fo-customer-overview-span {
    grid-column: 1 / -1;
}

.fo-customer-timeline-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--fo-space-md);
}

.fo-customer-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fo-customer-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-md);
    background: var(--fo-card);
}

.fo-customer-timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fo-customer-timeline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.fo-customer-timeline-title {
    font-weight: 600;
    background: none;
    border: none;
    color: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.fo-customer-properties-grid,
.fo-customer-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--fo-space-md);
}

.fo-card--selected {
    outline: 2px solid var(--fo-color-primary, #2563eb);
    outline-offset: 2px;
}

.fo-embedded-map-marker {
    background: transparent;
    border: none;
}

.fo-customer-insight-highlight {
    grid-column: 1 / -1;
}

.fo-customer-insight-list {
    margin: 0;
    padding-left: 1.25rem;
}

.fo-customer-doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.fo-customer-doc-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-md);
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.fo-customer-doc-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--fo-radius-sm);
}

.fo-customer-link {
    color: var(--fo-primary, #3b82f6);
    text-decoration: none;
    font-weight: 500;
}

.fo-customer-link:hover {
    text-decoration: underline;
}

/* Drawer */
.fo-customer-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

.fo-customer-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: var(--fo-card, #1e293b);
    border-left: 1px solid var(--fo-border);
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
}

.fo-customer-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--fo-space-md) var(--fo-space-lg);
    border-bottom: 1px solid var(--fo-border);
}

.fo-customer-drawer-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.fo-customer-drawer-close {
    border: none;
    background: transparent;
    color: inherit;
    padding: 0.5rem;
    cursor: pointer;
}

.fo-customer-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--fo-space-lg);
}

.fo-kpi-strip--compact .fo-kpi-card {
    min-width: 100px;
}

/* Phase 42 — Customer Intelligence */
.fo-customer-intel-card {
    margin-bottom: var(--fo-space-md);
}

.fo-customer-intel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.fo-customer-intel-recent {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.fo-customer-intel-recent li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--fo-border);
    font-size: 0.85rem;
}

.fo-comms-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.fo-comms-attachments {
    display: flex;
    gap: 0.75rem;
    font-size: 0.78rem;
    opacity: 0.85;
}

.fo-customer-notes-section {
    margin-top: 0.5rem;
}

.fo-customer-notes-compose {
    margin-bottom: 0.75rem;
}

.fo-customer-notes-compose-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.fo-customer-notes-validation {
    color: var(--fo-danger, #dc3545);
    font-size: var(--fo-font-sm, 0.875rem);
    margin: 0.35rem 0 0;
}

.fo-intel-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
}

.fo-customer-intel-dimensions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--fo-border-subtle, rgba(255, 255, 255, 0.08));
    font-size: 0.75rem;
    opacity: 0.85;
}
