/* ==========================================================================
   WorkBench Design System
   Salesforce Lightning-inspired enterprise dashboard
   ========================================================================== */

:root {
    /* Brand Colors */
    --wb-primary: #e74c3c;
    --wb-primary-hover: #c0392b;
    --wb-primary-light: rgba(231, 76, 60, 0.15);
    --wb-primary-ghost: rgba(231, 76, 60, 0.08);
    
    /* Branch Colors */
    --wb-branch-dayton: #e74c3c;
    --wb-branch-cincinnati: #27ae60;
    --wb-branch-lima: #3498db;
    
    /* Neutral Colors - Dark Theme */
    --wb-bg-dark: #111827;
    --wb-bg-card: #1f2937;
    --wb-bg-elevated: #374151;
    --wb-bg-hover: #4b5563;
    --wb-border: #374151;
    --wb-border-light: #4b5563;
    
    /* Text Colors */
    --wb-text-primary: #ffffff;
    --wb-text-secondary: #d1d5db;
    --wb-text-muted: #9ca3af;
    --wb-text-disabled: #6b7280;
    
    /* Status Colors */
    --wb-success: #10b981;
    --wb-success-light: rgba(16, 185, 129, 0.15);
    --wb-warning: #f59e0b;
    --wb-warning-light: rgba(245, 158, 11, 0.15);
    --wb-error: #ef4444;
    --wb-error-light: rgba(239, 68, 68, 0.15);
    --wb-info: #3b82f6;
    --wb-info-light: rgba(59, 130, 246, 0.15);
    
    /* Spacing Scale */
    --wb-space-xs: 0.25rem;
    --wb-space-sm: 0.5rem;
    --wb-space-md: 1rem;
    --wb-space-lg: 1.5rem;
    --wb-space-xl: 2rem;
    --wb-space-2xl: 3rem;
    
    /* Border Radius */
    --wb-radius-sm: 0.25rem;
    --wb-radius-md: 0.5rem;
    --wb-radius-lg: 0.75rem;
    --wb-radius-xl: 1rem;
    --wb-radius-full: 9999px;
    
    /* Shadows */
    --wb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --wb-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --wb-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --wb-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);
    
    /* Typography */
    --wb-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --wb-font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Consolas', monospace;
    
    /* Touch Targets */
    --wb-touch-min: 44px;
    
    /* Transitions */
    --wb-transition-fast: 150ms ease;
    --wb-transition-normal: 250ms ease;
    --wb-transition-slow: 350ms ease;
    
    /* Z-Index Scale */
    --wb-z-dropdown: 50;
    --wb-z-sticky: 60;
    --wb-z-fixed: 70;
    --wb-z-modal-backdrop: 80;
    --wb-z-modal: 90;
    --wb-z-popover: 100;
    --wb-z-tooltip: 110;
}

/* ==========================================================================
   Shared Component Classes
   ========================================================================== */

/* Cards */
.wb-card {
    background: var(--wb-bg-card);
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-radius-lg);
    padding: var(--wb-space-lg);
    transition: all var(--wb-transition-normal);
}

.wb-card:hover {
    border-color: var(--wb-border-light);
    box-shadow: var(--wb-shadow-md);
}

.wb-card-elevated {
    background: var(--wb-bg-elevated);
    border-color: var(--wb-border-light);
}

.wb-card-interactive {
    cursor: pointer;
}

.wb-card-interactive:hover {
    background: var(--wb-bg-elevated);
    transform: translateY(-1px);
}

/* Buttons */
.wb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--wb-space-sm);
    min-height: var(--wb-touch-min);
    padding: var(--wb-space-sm) var(--wb-space-md);
    border-radius: var(--wb-radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--wb-transition-fast);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.wb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wb-btn-primary {
    background: var(--wb-primary);
    color: white;
}

.wb-btn-primary:hover:not(:disabled) {
    background: var(--wb-primary-hover);
}

.wb-btn-secondary {
    background: var(--wb-bg-elevated);
    color: var(--wb-text-primary);
    border: 1px solid var(--wb-border);
}

.wb-btn-secondary:hover:not(:disabled) {
    background: var(--wb-bg-hover);
    border-color: var(--wb-border-light);
}

.wb-btn-ghost {
    background: transparent;
    color: var(--wb-text-secondary);
}

.wb-btn-ghost:hover:not(:disabled) {
    background: var(--wb-primary-ghost);
    color: var(--wb-primary);
}

.wb-btn-success {
    background: var(--wb-success);
    color: white;
}

.wb-btn-danger {
    background: var(--wb-error);
    color: white;
}

.wb-btn-sm {
    min-height: 32px;
    padding: var(--wb-space-xs) var(--wb-space-sm);
    font-size: 0.75rem;
}

.wb-btn-lg {
    min-height: 52px;
    padding: var(--wb-space-md) var(--wb-space-xl);
    font-size: 1rem;
}

/* Badges */
.wb-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--wb-space-xs);
    padding: var(--wb-space-xs) var(--wb-space-sm);
    border-radius: var(--wb-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.wb-badge-primary {
    background: var(--wb-primary-light);
    color: var(--wb-primary);
}

.wb-badge-success {
    background: var(--wb-success-light);
    color: var(--wb-success);
}

.wb-badge-warning {
    background: var(--wb-warning-light);
    color: var(--wb-warning);
}

.wb-badge-error {
    background: var(--wb-error-light);
    color: var(--wb-error);
}

.wb-badge-info {
    background: var(--wb-info-light);
    color: var(--wb-info);
}

.wb-badge-neutral {
    background: var(--wb-bg-elevated);
    color: var(--wb-text-secondary);
}

/* Form Controls */
.wb-input {
    width: 100%;
    min-height: var(--wb-touch-min);
    padding: var(--wb-space-sm) var(--wb-space-md);
    background: var(--wb-bg-dark);
    border: 1px solid var(--wb-border);
    border-radius: var(--wb-radius-md);
    color: var(--wb-text-primary);
    font-size: 0.875rem;
    transition: all var(--wb-transition-fast);
}

.wb-input:focus {
    outline: none;
    border-color: var(--wb-primary);
    box-shadow: 0 0 0 3px var(--wb-primary-ghost);
}

.wb-input::placeholder {
    color: var(--wb-text-disabled);
}

.wb-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tables */
.wb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wb-table th {
    background: var(--wb-bg-elevated);
    padding: var(--wb-space-sm) var(--wb-space-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wb-text-muted);
    border-bottom: 1px solid var(--wb-border);
}

.wb-table td {
    padding: var(--wb-space-md);
    border-bottom: 1px solid var(--wb-border);
    color: var(--wb-text-secondary);
    font-size: 0.875rem;
}

.wb-table tbody tr:hover {
    background: var(--wb-bg-elevated);
}

.wb-table-row {
    transition: background-color 0.15s ease;
}

.wb-table-row:hover {
    background: var(--wb-bg-elevated);
}

/* Loading States */
.wb-skeleton {
    background: linear-gradient(90deg, var(--wb-bg-elevated) 25%, var(--wb-bg-hover) 50%, var(--wb-bg-elevated) 75%);
    background-size: 200% 100%;
    animation: wb-shimmer 1.5s infinite;
    border-radius: var(--wb-radius-sm);
}

@keyframes wb-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.wb-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--wb-border);
    border-top-color: var(--wb-primary);
    border-radius: 50%;
    animation: wb-spin 0.8s linear infinite;
}

@keyframes wb-spin {
    to { transform: rotate(360deg); }
}

/* Empty States */
.wb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--wb-space-2xl);
    text-align: center;
    color: var(--wb-text-muted);
}

.wb-empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--wb-space-md);
    opacity: 0.5;
}

.wb-empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wb-text-secondary);
    margin-bottom: var(--wb-space-sm);
}

.wb-empty-state-description {
    font-size: 0.875rem;
    max-width: 300px;
}

/* Modal Components */
.wb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--wb-space-md);
}

.wb-modal {
    background: var(--wb-bg-dark);
    border-radius: var(--wb-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    width: 100%;
    transform: translateY(0);
    transition: transform 0.2s ease;
}

.wb-modal-header {
    padding: var(--wb-space-md);
    border-radius: var(--wb-radius-lg) var(--wb-radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.wb-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--wb-space-md);
}

.wb-modal-footer {
    padding: var(--wb-space-md);
    border-top: 1px solid var(--wb-border);
    flex-shrink: 0;
}

/* Focus States - Accessibility */
.wb-focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--wb-primary-ghost), 0 0 0 1px var(--wb-primary);
}

.wb-focus-visible:focus-visible {
    outline: 2px solid var(--wb-primary);
    outline-offset: 2px;
}

/* Default focus-visible for all interactive elements */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
[role="menuitem"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--wb-primary);
    outline-offset: 2px;
}

/* Screen Reader Only - Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Allow sr-only elements to be focusable when focused */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: inherit;
}

/* Skip link for keyboard navigation */
.wb-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--wb-primary);
    color: white;
    padding: var(--wb-space-sm) var(--wb-space-md);
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--wb-radius-md) 0;
    transition: top 0.2s ease;
}

.wb-skip-link:focus {
    top: 0;
}

/* Enhanced color contrast for secondary text */
.wb-text-secondary-contrast {
    color: #e5e7eb; /* Lighter than --wb-text-secondary for better contrast */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --wb-text-secondary: #e5e7eb;
        --wb-text-muted: #d1d5db;
        --wb-border: #4b5563;
        --wb-border-light: #6b7280;
    }
    
    .wb-btn {
        border: 2px solid currentColor;
    }
    
    .wb-card {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicator for icon-only buttons */
.wb-btn-icon {
    position: relative;
}

.wb-btn-icon:focus-visible::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--wb-primary);
    border-radius: inherit;
    pointer-events: none;
}

/* Hero Sections */
.wb-hero {
    background: linear-gradient(135deg, var(--wb-bg-card) 0%, var(--wb-bg-elevated) 100%);
    border-radius: var(--wb-radius-xl);
    padding: var(--wb-space-xl);
    margin-bottom: var(--wb-space-lg);
    border: 1px solid var(--wb-border);
}

.wb-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wb-text-primary);
    margin-bottom: var(--wb-space-sm);
}

.wb-hero-subtitle {
    font-size: 0.875rem;
    color: var(--wb-text-muted);
}

/* Metadata Grid */
.wb-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--wb-space-md);
}

.wb-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--wb-space-xs);
}

.wb-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wb-text-muted);
}

.wb-meta-value {
    font-size: 0.875rem;
    color: var(--wb-text-primary);
    font-weight: 500;
}

/* Section Headers */
.wb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--wb-space-md);
    margin-bottom: var(--wb-space-md);
    border-bottom: 1px solid var(--wb-border);
}

.wb-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wb-text-primary);
}

/* Mobile Utilities */
@media (max-width: 767px) {
    .wb-hide-mobile { display: none !important; }
    .wb-stack-mobile { flex-direction: column !important; }
    
    .wb-card {
        padding: var(--wb-space-md);
        border-radius: var(--wb-radius-md);
    }
    
    .wb-hero {
        padding: var(--wb-space-md);
    }
    
    .wb-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .wb-hide-desktop { display: none !important; }
}

/* ==========================================================================
   Original Styles (preserved and enhanced)
   ========================================================================== */

.tab {
    /* Mobile-first: 44px minimum tap target (iOS guidelines) */
    min-height: var(--wb-touch-min);
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--wb-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--wb-transition-normal);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Larger tap targets on desktop */
@media (min-width: 768px) {
    .tab {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

.tab:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.tab.active {
    color: #fff;
    border-bottom-color: #e74c3c;
    background: rgba(239, 68, 68, 0.2);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.inbound-item, .pinned-item {
    padding: 1rem;
    background: #1f2937;
    border-left: 4px solid #e74c3c;
    border-radius: 0.25rem;
    transition: all 0.3s;
}

.inbound-item:hover, .pinned-item:hover {
    background: #374151;
}

.inbound-item.dayton {
    border-left-color: #e74c3c;
}

.inbound-item.cincinnati {
    border-left-color: #27ae60;
}

.inbound-item.lima {
    border-left-color: #3498db;
}

.rate-card {
    background: #1f2937;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
}

.rate-label {
    font-size: 0.875rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rate-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.tracking-event {
    padding: 0.75rem;
    background: #374151;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.tracking-event:first-child {
    border-left: 4px solid #27ae60;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1f2937;
    padding: 2rem;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-only {
    display: none;
}

.admin-only.visible {
    display: block;
}

/* Admin Panel Sidebar Navigation */
.admin-nav-btn {
    background: transparent;
    color: #9CA3AF;
    border: none;
    transition: all 0.2s ease;
}

.admin-nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #E5E7EB;
}

.admin-nav-btn.active {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
    border-left: 3px solid #E74C3C;
}

.admin-section-content {
    display: none;
}

.admin-section-content.active,
.admin-section-content:not(.hidden) {
    display: block;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

.truck-icon {
    display: inline-block;
    animation: truckMove 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes truckMove {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

.user-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-badge.admin {
    background: #e74c3c;
    color: white;
}

.user-badge.power_user {
    background: #3498db;
    color: white;
}

.user-badge.user {
    background: #6b7280;
    color: white;
}

.sub-tab {
    /* Mobile-first: 44px minimum tap target */
    min-height: 44px;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 0.875rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .sub-tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

.sub-tab:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.sub-tab.active {
    color: #fff;
    border-bottom-color: #e74c3c;
    background: rgba(239, 68, 68, 0.15);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

.rate-verify-subtab {
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s;
}

.rate-verify-subtab:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.rate-verify-subtab.active {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
}

.rate-verify-subtab-content {
    display: none;
}

.rate-verify-subtab-content.active {
    display: block;
}

.eclipse-tab {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.eclipse-tab:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.eclipse-tab.active {
    color: #fff;
    border-bottom-color: #e74c3c;
    background: rgba(239, 68, 68, 0.15);
}

.eclipse-tab-content {
    display: none;
}

.eclipse-tab-content.active {
    display: block;
}

.eclipse-subtab {
    /* Mobile-first: 44px minimum tap target */
    min-height: 44px;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 0.875rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .eclipse-subtab {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

.eclipse-subtab:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.1);
}

.eclipse-subtab.active {
    color: #fff;
    border-bottom-color: #e74c3c;
    background: rgba(239, 68, 68, 0.15);
}

.eclipse-subtab-content {
    display: none;
}

.eclipse-subtab-content.active {
    display: block;
}

/* ========================
   SHOPPING CART STYLES
   ======================== */

/* Cart badge */
#cartBadge {
    animation: cart-badge-pulse 2s infinite;
}

@keyframes cart-badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Cart table */
#cartContent table {
    border-collapse: collapse;
}

#cartContent th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#cartContent td input[type="number"],
#cartContent td select {
    transition: all 0.2s;
}

#cartContent td input[type="number"]:focus,
#cartContent td select:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px;
    ring-color: rgba(59, 130, 246, 0.3);
}

/* Cart empty state */
#cartEmpty svg {
    opacity: 0.5;
}

/* Add to Cart button */
.add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Cart item row hover */
#cartContent tbody tr:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Cart totals section */
.cart-totals {
    background: linear-gradient(to bottom, #1f2937, #111827);
}

/* Availability badges */
.availability-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* GP% badges */
.gp-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Cart modal */
.cart-modal {
    animation: cart-modal-fade-in 0.2s ease-out;
}

@keyframes cart-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile responsive cart table */
@media (max-width: 768px) {
    #cartContent table {
        font-size: 0.875rem;
    }
    
    #cartContent th,
    #cartContent td {
        padding: 0.5rem !important;
    }
    
    #cartContent .cart-totals {
        font-size: 0.875rem;
    }
}

/* Cart loading state */
.cart-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.2s ease-out;
}

/* Contact modal polish */
.contact-modal-content {
    transition: all 0.3s ease;
}

.contact-modal-content:hover {
    transform: translateY(-2px);
}

/* Activity triggers list */
.activity-trigger-item {
    transition: background-color 0.2s ease;
}

.activity-trigger-item:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Button hover effects */
button[onclick*="loadCustomerContacts"],
button[onclick*="loadVendorContacts"],
button[onclick*="loadActivityTriggers"] {
    transition: all 0.2s ease;
}

button[onclick*="loadCustomerContacts"]:hover,
button[onclick*="loadVendorContacts"]:hover,
button[onclick*="loadActivityTriggers"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Clickable contact items */
.clickable-contact {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.clickable-contact:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    transform: translateX(4px);
}

/* Loading spinner polish */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Success/Error message animations */
.success-message {
    animation: slideInRight 0.3s ease-out;
}

.error-message {
    animation: shake 0.5s ease-in-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Pin/Unpin animations */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(234, 179, 8, 0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.fade-out {
    animation: fadeOut 300ms ease-out forwards;
}

.pulse-once {
    animation: pulse 1s ease-out;
}

.shake-button {
    animation: shake 0.5s ease-in-out;
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ========================================
   Generation Selector Modal Animations
   ======================================== */

/* Modal entrance animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.generation-modal-overlay {
    animation: fadeIn 0.2s ease-out;
}

.generation-modal-container {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Generation card styling */
.generation-card {
    position: relative;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.9));
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.generation-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 1rem;
}

.generation-card:hover::before {
    opacity: 1;
}

.generation-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 40px -12px rgba(139, 92, 246, 0.3),
                0 0 30px rgba(139, 92, 246, 0.2);
}

/* Latest generation highlight */
.generation-card.latest {
    border: 2px solid rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
}

.generation-card.latest::after {
    content: '✨ Latest';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
    }
}

/* Selected state */
.generation-card.selected {
    border-color: rgba(139, 92, 246, 0.8);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.15));
    transform: translateY(-2px);
}

.generation-card.selected::before {
    opacity: 1;
}

/* Status chip animations */
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

.status-chip.open {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.2));
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-chip.invoice {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.closed {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(75, 85, 99, 0.2));
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-chip.bid {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-chip.backorder {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Recent orders sidebar */
.recent-order-item {
    padding: 0.75rem;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.recent-order-item:hover {
    background: rgba(55, 65, 81, 0.7);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateX(4px);
}

/* Skeleton loading animation */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(55, 65, 81, 0.4) 25%,
        rgba(75, 85, 99, 0.4) 50%,
        rgba(55, 65, 81, 0.4) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth entrance for generation cards when they load */
.generation-card-enter {
    animation: cardSlideIn 0.4s ease-out;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI summary pill styling */
.ai-summary-pill {
    display: inline-block;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #c084fc;
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.ai-summary-pill:hover {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(139, 92, 246, 0.25));
    border-color: rgba(168, 85, 247, 0.5);
}

/* Glassmorphism effect for modal backdrop */
.generation-modal-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* View Latest button glow effect */
button[onclick="loadLatestGeneration()"]:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

/* Keyboard shortcut badge styling */
kbd {
    font-family: monospace;
    font-size: 0.75rem;
}

/* Mobile responsive tweaks */
@media (max-width: 1024px) {
    .generation-card {
        padding: 1rem;
    }
    
    .generation-modal-container {
        max-width: 100%;
        margin: 1rem;
    }
}

/* AI Assistant Animations */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

/* Custom scrollbar for AI chat */
#aiMessages::-webkit-scrollbar {
    width: 6px;
}

#aiMessages::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 3px;
}

#aiMessages::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 3px;
}

#aiMessages::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* AI Assistant background colors */
.bg-gray-750 {
    background-color: #2d3748;
}

.bg-gray-850 {
    background-color: #1a202c;
}

/* ===== MOBILE UTILITY CLASSES ===== */

/* Line clamp utilities for truncating text */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile-optimized scrolling */
.scroll-smooth {
    scroll-behavior: smooth;
}

.scroll-touch {
    -webkit-overflow-scrolling: touch;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Touch-friendly tap highlight */
.tap-highlight-none {
    -webkit-tap-highlight-color: transparent;
}

/* Safe area insets for notched devices */
.safe-area-inset-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-inset-top {
    padding-top: env(safe-area-inset-top);
}

/* Mobile-optimized flex gaps */
@media (max-width: 767px) {
    .gap-mobile-sm { gap: 8px !important; }
    .gap-mobile-md { gap: 12px !important; }
    .gap-mobile-lg { gap: 16px !important; }
    
    /* Reduce padding on mobile */
    .p-mobile-compact { padding: 12px !important; }
    .px-mobile-compact { padding-left: 12px !important; padding-right: 12px !important; }
    .py-mobile-compact { padding-top: 8px !important; padding-bottom: 8px !important; }
    
    /* Mobile text sizes */
    .text-mobile-sm { font-size: 12px !important; }
    .text-mobile-base { font-size: 14px !important; }
    .text-mobile-lg { font-size: 16px !important; }
    
    /* Hide on mobile */
    .hidden-mobile { display: none !important; }
    
    /* Show only on mobile */
    .show-mobile { display: block !important; }
    .flex-mobile { display: flex !important; }
}

/* ===== MOBILE BOTTOM SHEET & FAB STYLES ===== */

/* Mobile FAB (Floating Action Button) for Notes/Tasks */
.mobile-sidebar-fab {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.5);
}

.mobile-sidebar-fab:active {
    transform: scale(0.95);
}

.mobile-sidebar-fab.mobile-visible {
    display: flex;
}

/* Bottom sheet handle for dragging */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #6b7280;
    border-radius: 2px;
    margin: 12px auto;
}

/* Mobile bottom sheet overlay */
#mobileBottomSheetOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#mobileBottomSheetOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* Order/PO detail sidebars - bottom sheet on mobile */
@media (max-width: 1023px) {
    .order-detail-sidebar,
    .po-detail-sidebar,
    .vendor-sidebar,
    .customer-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        max-height: 85vh;
        height: 85vh;
        border-radius: 16px 16px 0 0;
        border-top: 1px solid #374151;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
        z-index: 200;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        touch-action: pan-y;
    }
    
    .order-detail-sidebar.mobile-open,
    .po-detail-sidebar.mobile-open,
    .vendor-sidebar.mobile-open,
    .customer-sidebar.mobile-open {
        transform: translateY(0);
    }
    
    /* Ensure sidebar content is scrollable and interactive */
    .order-detail-sidebar #sidebarContent,
    .po-detail-sidebar #poSidebarContent,
    .vendor-sidebar .sidebar-content,
    .customer-sidebar .sidebar-content {
        padding-bottom: 100px;
        pointer-events: auto;
    }
    
    /* Make sure bottom sheet handle is visible */
    .order-detail-sidebar .bottom-sheet-handle,
    .po-detail-sidebar .bottom-sheet-handle,
    .vendor-sidebar .bottom-sheet-handle,
    .customer-sidebar .bottom-sheet-handle {
        display: block;
    }
    
    /* Hide desktop resize handle on mobile */
    #sidebarResizeHandle,
    #vendorSidebarResizeHandle,
    #customerSidebarResizeHandle,
    #poSidebarResizeHandle {
        display: none !important;
    }
    
    /* Hide collapsed sidebar tab on mobile */
    #collapsedSidebarTab,
    #vendorCollapsedSidebarTab,
    #customerCollapsedSidebarTab,
    #poCollapsedSidebarTab {
        display: none !important;
    }
    
    /* Show FAB on mobile */
    .mobile-sidebar-fab {
        display: flex;
    }
    
    /* Adjust main content to not overlap with FAB */
    #orderMainContent,
    #poMainContent,
    #vendorMainContent,
    #customerMainContent {
        padding-bottom: 80px;
    }
}

/* Desktop: hide FAB, show sidebar normally */
@media (min-width: 1024px) {
    .mobile-sidebar-fab {
        display: none !important;
    }
    
    .order-detail-sidebar,
    .po-detail-sidebar,
    .vendor-sidebar,
    .customer-sidebar {
        position: relative;
        transform: none;
        max-height: none;
        border-radius: 0;
    }
}

/* ==========================================================================
   Webex Phone Panel - Premium Sliding Drawer
   ========================================================================== */

.wpp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99989;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.wpp-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.webex-phone-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    will-change: transform;
}
.webex-phone-panel.open {
    transform: translateX(0);
}

.wpp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.wpp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wpp-header-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}
.wpp-header-title {
    color: #f1f5f9;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.3px;
}
.wpp-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wpp-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
}
.wpp-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wpp-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s;
}
.wpp-status-dot.connected { background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,0.5); }
.wpp-status-dot.disconnected { background: #ef4444; box-shadow: 0 0 8px rgba(239,68,68,0.3); }
.wpp-status-dot.dnd { background: #f59e0b; box-shadow: 0 0 8px rgba(245,158,11,0.4); }
.wpp-status-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}
.wpp-status-toggle-group {
    display: flex;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #334155;
}
.wpp-status-toggle-btn {
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #94a3b8;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wpp-status-toggle-btn.active-ready {
    background: #22c55e;
    color: #fff;
}
.wpp-status-toggle-btn.active-dnd {
    background: #ef4444;
    color: #fff;
}
.wpp-status-toggle-btn:hover:not(.active-ready):not(.active-dnd) {
    background: #1e293b;
    color: #e2e8f0;
}

.wpp-close-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}
.wpp-close-btn:hover {
    background: #334155;
    color: #fff;
}

.wpp-dialer {
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
    position: relative;
}
.wpp-dialer-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.wpp-input {
    flex: 1;
    padding: 10px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}
.wpp-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.wpp-input::placeholder { color: #64748b; }

.wpp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    background: #334155;
    white-space: nowrap;
}
.wpp-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.wpp-btn:active { transform: translateY(0); }
.wpp-btn-call {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    padding: 0;
    font-size: 16px;
}
.wpp-btn-call:hover { box-shadow: 0 4px 12px rgba(34,197,94,0.4); }
.wpp-btn-hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.wpp-search-results {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    display: none;
}
.wpp-search-results.visible { display: block; }
.wpp-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #0f172a;
}
.wpp-search-item:last-child { border-bottom: none; }
.wpp-search-item:hover { background: #334155; }
.wpp-search-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.wpp-search-avatar.customer { background: #3b82f6; }
.wpp-search-avatar.vendor { background: #8b5cf6; }
.wpp-search-avatar.contact { background: #f59e0b; }
.wpp-search-info { flex: 1; min-width: 0; }
.wpp-search-name { color: #f1f5f9; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpp-search-meta { color: #64748b; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wpp-search-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.wpp-search-badge.customer { background: rgba(59,130,246,0.2); color: #60a5fa; }
.wpp-search-badge.vendor { background: rgba(139,92,246,0.2); color: #a78bfa; }

.wpp-tabs {
    display: flex;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
    padding: 0 4px;
}
.wpp-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.wpp-tab:hover { color: #94a3b8; }
.wpp-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}
.wpp-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: 700;
    background: #e74c3c;
    color: #fff;
    border-radius: 8px;
}
.wpp-tab-badge.hidden { display: none; }

.wpp-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.wpp-content::-webkit-scrollbar { width: 5px; }
.wpp-content::-webkit-scrollbar-track { background: transparent; }
.wpp-content::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.wpp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}
.wpp-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.wpp-empty-icon i { font-size: 24px; color: #475569; }
.wpp-empty-title { color: #94a3b8; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.wpp-empty-subtitle { color: #475569; font-size: 12px; }
.wpp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 24px;
    color: #64748b;
    font-size: 13px;
}

.wpp-call-card {
    padding: 14px 16px;
    border-bottom: 1px solid #1e293b;
    transition: background 0.2s;
}
.wpp-call-card.connected {
    border-left: 3px solid #22c55e;
    background: rgba(34,197,94,0.05);
}
.wpp-call-card.held {
    border-left: 3px solid #f59e0b;
    background: rgba(245,158,11,0.05);
}
.wpp-call-card.ringing {
    border-left: 3px solid #3b82f6;
    background: rgba(59,130,246,0.08);
    animation: wpp-pulse 2s infinite;
}
@keyframes wpp-pulse {
    0%, 100% { background: rgba(59,130,246,0.05); }
    50% { background: rgba(59,130,246,0.12); }
}
.wpp-call-info { margin-bottom: 10px; }
.wpp-call-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.wpp-call-name {
    color: #f1f5f9;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wpp-call-state {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.wpp-state-connected { background: rgba(34,197,94,0.15); color: #22c55e; }
.wpp-state-held { background: rgba(245,158,11,0.15); color: #f59e0b; }
.wpp-state-ringing { background: rgba(59,130,246,0.15); color: #60a5fa; }
.wpp-call-number {
    color: #64748b;
    font-size: 12px;
}
.wpp-call-context {
    margin-top: 8px;
    padding: 8px 10px;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
}
.wpp-call-context-name {
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.wpp-call-context-name:hover { text-decoration: underline; }
.wpp-call-context-meta {
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
}
.wpp-call-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wpp-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #fff;
    background: #334155;
    position: relative;
}
.wpp-action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.wpp-action-btn:active { transform: translateY(0); }
.wpp-action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 10px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 6px;
    pointer-events: none;
    border: 1px solid #334155;
    z-index: 5;
}
.wpp-action-btn.answer { background: #22c55e; }
.wpp-action-btn.answer:hover { background: #16a34a; }
.wpp-action-btn.reject, .wpp-action-btn.hangup { background: #ef4444; }
.wpp-action-btn.reject:hover, .wpp-action-btn.hangup:hover { background: #dc2626; }
.wpp-action-btn.hold { background: #f59e0b; }
.wpp-action-btn.hold:hover { background: #d97706; }
.wpp-action-btn.resume { background: #22c55e; }
.wpp-action-btn.transfer { background: #8b5cf6; }
.wpp-action-btn.park { background: #6366f1; }
.wpp-action-btn.record { background: #334155; }
.wpp-action-btn.record.recording { background: #ef4444; animation: wpp-rec-pulse 1.5s infinite; }
@keyframes wpp-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.wpp-action-btn.mute { background: #334155; }
.wpp-action-btn.mute.muted { background: #ef4444; }
.wpp-action-btn.conference { background: #0ea5e9; }

.wpp-retrieve-section {
    padding: 12px 16px;
    border-top: 1px solid #1e293b;
}
.wpp-retrieve-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wpp-log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #0f172a;
}
.wpp-log-item:hover { background: #1e293b; }
.wpp-log-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.wpp-log-icon.inbound { background: rgba(34,197,94,0.15); color: #22c55e; }
.wpp-log-icon.outbound { background: rgba(59,130,246,0.15); color: #60a5fa; }
.wpp-log-icon.missed { background: rgba(239,68,68,0.15); color: #ef4444; }
.wpp-log-info { flex: 1; min-width: 0; }
.wpp-log-name {
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wpp-log-meta {
    color: #64748b;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.wpp-log-entity-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    background: rgba(59,130,246,0.2);
    color: #60a5fa;
}
.wpp-log-time {
    text-align: right;
    flex-shrink: 0;
    color: #64748b;
    font-size: 11px;
}
.wpp-disposition-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(148,163,184,0.15);
    color: #94a3b8;
    text-transform: capitalize;
    margin-top: 2px;
}

.wpp-ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 3px;
    background: rgba(39,174,96,0.15);
    color: #27ae60;
    margin-left: 6px;
    cursor: pointer;
    transition: background 0.15s;
    vertical-align: middle;
}

.wpp-ticket-badge:hover {
    background: rgba(39,174,96,0.3);
}

.wpp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #1e293b;
    background: #0f172a;
}
.wpp-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpp-settings-section {
    padding: 16px;
}
.wpp-settings-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.wpp-settings-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.wpp-settings-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.wpp-settings-btn:last-child { margin-bottom: 0; }
.wpp-settings-btn:hover { background: #1e293b; border-color: #475569; }
.wpp-settings-btn i { color: #64748b; width: 16px; text-align: center; }

.wpp-connection-card {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #334155;
}
.wpp-connection-card.connected { background: rgba(34,197,94,0.05); border-color: rgba(34,197,94,0.2); }
.wpp-connection-card.disconnected { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.2); }

.wpp-transfer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.95);
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}
.wpp-transfer-title {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpp-incoming-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wpp-incoming-card {
    background: linear-gradient(160deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}
.wpp-incoming-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    border: 2px solid #3b82f6;
    animation: wpp-incoming-ring 2s infinite;
}
@keyframes wpp-incoming-ring {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}
.wpp-incoming-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: wpp-bounce 1s infinite;
}
@keyframes wpp-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.wpp-incoming-icon i { color: #fff; }
.wpp-incoming-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #3b82f6;
    margin-bottom: 8px;
}
.wpp-incoming-name {
    color: #f1f5f9;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.wpp-incoming-number {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 24px;
}
.wpp-incoming-context {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 20px;
    text-align: left;
}
.wpp-incoming-context-name { color: #60a5fa; font-size: 13px; font-weight: 600; }
.wpp-incoming-context-meta { color: #64748b; font-size: 11px; margin-top: 2px; }
.wpp-incoming-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.wpp-incoming-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    transition: all 0.2s;
}
.wpp-incoming-btn i { font-size: 20px; }
.wpp-incoming-btn.answer { background: #22c55e; }
.wpp-incoming-btn.answer:hover { background: #16a34a; transform: scale(1.05); }
.wpp-incoming-btn.reject { background: #ef4444; }
.wpp-incoming-btn.reject:hover { background: #dc2626; transform: scale(1.05); }
.wpp-incoming-btn.voicemail { background: #6366f1; }
.wpp-incoming-btn.voicemail:hover { background: #4f46e5; transform: scale(1.05); }
.wpp-incoming-dismiss {
    display: block;
    margin: 16px auto 0;
    background: none;
    border: none;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
}
.wpp-incoming-dismiss:hover { color: #94a3b8; }

.wpp-dnd-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.wpp-dnd-btn:hover { background: #334155; }

.wpp-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.wpp-toggle input { opacity: 0; width: 0; height: 0; }
.wpp-toggle-slider {
    position: absolute;
    inset: 0;
    background: #334155;
    border-radius: 11px;
    cursor: pointer;
    transition: 0.3s;
}
.wpp-toggle-slider:before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
.wpp-toggle input:checked + .wpp-toggle-slider { background: #e74c3c; }
.wpp-toggle input:checked + .wpp-toggle-slider:before { transform: translateX(18px); }

.webex-phone-header-btn.ringing {
    animation: wpp-header-ring 0.6s ease-in-out infinite alternate;
}
@keyframes wpp-header-ring {
    from { transform: rotate(-8deg); }
    to { transform: rotate(8deg); }
}
.webex-phone-header-btn.has-calls { color: #22c55e !important; }

.wpp-call-timer {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}

.wpp-follow-up-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}
.wpp-follow-up-btn:hover { background: #334155; color: #e2e8f0; }

@media (max-width: 480px) {
    .webex-phone-panel { width: 100%; }
    .wpp-incoming-card { padding: 24px 20px; }
    .wpp-incoming-actions { flex-direction: column; }
}
