:root {
    --bp-navy: #1B365D;
    --bp-navy-dark: #142848;
    --bp-navy-light: #2A4A7A;
    --bp-green: #3D8B40;
    --bp-green-light: #4CAF50;
    --nav-height: 56px;
    --touch-target: 48px;
    --card-padding: 12px;
    --content-max-width: 1200px;
}

html, body {
    font-family: 'Inter', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile bottom nav spacing */
.pb-16 {
    padding-bottom: 72px !important;
}

@media (min-width: 960px) {
    :root {
        --nav-height: 0px;
        --card-padding: 16px;
    }

    .pb-16 {
        padding-bottom: 0 !important;
    }
}

/* Bottom navigation */
.mud-bottom-nav {
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* ── Mobile "More" bottom sheet ──────────────────────────────────────── */

.bp-mobile-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 72px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bp-mobile-sheet--open {
    transform: translateY(0);
}

.bp-mobile-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--mud-palette-lines-default);
    border-radius: 2px;
    margin: 10px auto 4px;
    cursor: pointer;
}

/* Login page */
.bp-login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bp-navy) 0%, var(--bp-navy-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bp-login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    width: 100%;
}

.bp-login-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.bp-login-logo {
    margin-bottom: 16px;
}

.bp-login-brand {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bp-navy);
    letter-spacing: 0.01em;
}

.bp-login-brand span {
    color: var(--bp-green);
}

.bp-login-subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
}

.bp-login-footer {
    margin-top: 32px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

/* Mobile app bar - ensure content doesn't hide behind it */
.mt-12 {
    margin-top: 48px !important;
}

@media (min-width: 960px) {
    .mt-12.mt-md-0 {
        margin-top: 0 !important;
    }
}

/* Stage chip colors */
.stage-new { background: #e3f2fd !important; color: #1565c0 !important; }
.stage-contacted { background: #f3e5f5 !important; color: #7b1fa2 !important; }
.stage-qualified { background: #e8f5e9 !important; color: #2e7d32 !important; }
.stage-proposal { background: #fff3e0 !important; color: #e65100 !important; }
.stage-negotiating { background: #fce4ec !important; color: #c62828 !important; }
.stage-won { background: #e8f5e9 !important; color: #1b5e20 !important; }
.stage-lost { background: #fafafa !important; color: #616161 !important; }

/* Temperature indicators */
.temp-hot { color: #d32f2f !important; }
.temp-warm { color: #f57c00 !important; }
.temp-cold { color: #1976d2 !important; }

/* Overdue indicator pulse */
@keyframes overdue-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.overdue-indicator {
    animation: overdue-pulse 2s ease-in-out infinite;
    color: #d32f2f;
}

/* KPI stat cards — centered vertical layout */
.bp-kpi-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 8px;
    min-height: 120px;
    gap: 2px;
}

/* Clickable KPI stat cards */
.bp-kpi-stat--link {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .bp-kpi-stat--link:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

.bp-kpi-stat--link:active {
    transform: scale(0.97);
}

/* KPI cards (legacy / accent variants) */
.bp-kpi-card {
    border-left: 4px solid var(--bp-navy);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bp-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bp-kpi-card.accent {
    border-left-color: var(--bp-green);
}

.bp-kpi-card.warning {
    border-left-color: #f59e0b;
}

.bp-kpi-card.danger {
    border-left-color: #ef4444;
}

/* Lead card touch interaction */
.bp-lead-card {
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.bp-lead-card:active {
    transform: scale(0.98);
}

@media (hover: hover) {
    .bp-lead-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
}

/* Pipeline stage tab active indicator */
.bp-stage-tab-active {
    border-bottom: 3px solid var(--bp-navy);
    font-weight: 600;
}

/* Scrollable horizontal tabs for mobile pipeline */
.bp-pipeline-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
}

.bp-pipeline-tabs::-webkit-scrollbar {
    display: none;
}

/* Activity timeline */
.bp-timeline-system {
    opacity: 0.7;
    font-style: italic;
}

/* Key dates timeline – center dots on the connecting line */
.bp-key-dates.mud-timeline-vertical.mud-timeline-position-start::before {
    left: 48px;
}

/* Ensure drawer content stretches for flex layout */
.mud-drawer .mud-drawer-content {
    display: flex;
    flex-direction: column;
}

/* Nav scope fills drawer height */
.bp-nav-scope {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ── Icon-Only Nav: Drawer Overflow Fixes ─────────────────────────────── */

.bp-nav-icononly {
    overflow: visible !important;
}

.bp-nav-icononly .mud-drawer-content,
.bp-nav-icononly .mud-drawer-paper,
.bp-nav-icononly .mud-navmenu,
.bp-nav-icononly .mud-navmenu .mud-nav-menu {
    overflow: visible !important;
}

.bp-nav-scope--icononly {
    position: relative;
    overflow: visible !important;
}

/* In icon-only mode: hide nav text, group titles, and expand icons. */
.bp-nav-icononly .mud-nav-link-text,
.bp-nav-icononly .mud-navgroup-text,
.bp-nav-icononly .mud-nav-group-title,
.bp-nav-icononly .mud-nav-group-expand-icon {
    display: none !important;
}

.bp-nav-icononly .mud-nav-link,
.bp-nav-icononly .mud-nav-group {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.bp-nav-icononly .mud-nav-link .mud-icon-root {
    margin-right: 0;
}

/* ── Icon-Only Nav: Flyout Container ──────────────────────────────────── */

.bp-nav-flyout {
    padding-top: 8px;
}

/* ── Icon-Only Nav: Flyout Icon Items ─────────────────────────────────── */

.bp-flyout-item {
    position: relative;
    display: flex;
    justify-content: center;
    border-radius: 8px;
}

.bp-flyout-item .mud-icon-button {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.bp-flyout-item .mud-icon-button .mud-icon-root {
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

.bp-flyout-item .mud-icon-button .mud-icon-root svg {
    width: 20px !important;
    height: 20px !important;
}

.bp-flyout-item:hover .mud-icon-button {
    background-color: var(--mud-palette-action-hover);
}

/* Active route highlight */
.bp-flyout-item--active .mud-icon-button {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 18%, var(--mud-palette-surface)) !important;
    box-shadow: inset -4px 0 0 0 var(--mud-palette-primary) !important;
}

@supports not (background-color: color-mix(in srgb, white 10%, black)) {
    .bp-flyout-item--active .mud-icon-button {
        background-color: var(--mud-palette-action-hover) !important;
    }
}

/* ── Icon-Only Nav: Flyout Panels ─────────────────────────────────────── */

.bp-flyout-panel {
    display: none;
    position: absolute;
    left: 56px;
    top: 0;
    width: 240px;
    z-index: 3000;
    padding-bottom: 6px;
}

.bp-flyout-item:hover .bp-flyout-panel {
    display: block;
}

/* ── Icon-Only Nav: Flyout Links ──────────────────────────────────────── */

.bp-flyout-link {
    display: block;
    padding: 8px 12px;
    margin: 0 6px;
    border-radius: 6px;
    color: var(--mud-palette-text-primary);
    transition: background-color 0.15s ease;
}

.bp-flyout-link:hover {
    background-color: var(--mud-palette-action-default-hover);
}

/* Transition for drawer width changes */
.mud-drawer {
    transition: width 0.2s ease;
}

/* Hide MudStepper's built-in Previous/Next action buttons when using custom dialog actions */
.hide-stepper-actions .mud-stepper-actions,
.hide-stepper-actions .mud-stepper-button-previous,
.hide-stepper-actions .mud-stepper-button-next {
    display: none !important;
}
