/* Base & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #F3F4F6;
    color: #1F2937;
    overflow: hidden;
}

/* Custom Scrollbar for Enterprise Feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #0F172A; /* Dark Navy / Slate 900 */
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 20;
}

.sidebar-header {
    padding: 32px 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    background: linear-gradient(135deg, #6366F1, #8B5CF6); /* Indigo to Violet */
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.5px;
}

.logo-text span {
    font-weight: 300;
    color: #94A3B8;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    text-decoration: none;
    color: #94A3B8;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    transform: translateX(4px);
}

.nav-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: #FFFFFF;
}

.nav-item.active i {
    color: #6366F1;
}

.nav-item.ai-nav {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, transparent 100%);
    border-left: 3px solid #8B5CF6;
    color: #E2E8F0;
}

.nav-item i {
    width: 22px;
    text-align: center;
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #FFFFFF;
}

.user-role {
    font-size: 0.8rem;
    color: #94A3B8;
    margin-top: 2px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Header */
.top-header {
    height: 80px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 10;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 12px 20px;
    border-radius: 30px;
    width: 450px;
    transition: all 0.3s ease;
}

.header-search:focus-within {
    border-color: #6366F1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background-color: #FFFFFF;
}

.header-search i {
    color: #9CA3AF;
}

.header-search input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: #374151;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #8B5CF6;
    background-color: #F5F3FF;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid #EDE9FE;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #8B5CF6;
    border-radius: 50%;
    display: inline-block;
}

.pulse {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.icon-btn {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    color: #1F2937;
    border-color: #D1D5DB;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Content Area */
.content-wrapper {
    padding: 40px;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.page-title {
    margin-bottom: 32px;
}

.page-title h2 {
    font-size: 2rem;
    color: #111827;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-title p {
    color: #6B7280;
    margin-top: 6px;
    font-size: 1rem;
}

/* Glass Panels */
.glass-panel {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 32px;
    margin-bottom: 40px;
}

.panel-header h3 {
    font-size: 1.25rem;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.panel-header h3 i {
    color: #6366F1;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4B5563;
}

.input-group input {
    padding: 12px 16px;
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1F2937;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    background-color: #FFFFFF;
    border-color: #6366F1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

/* Customer Section */
.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-actions h3 {
    font-size: 1.4rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions h3 i {
    color: #6366F1;
}

.filter-group {
    display: flex;
    background-color: #E5E7EB;
    border-radius: 10px;
    padding: 4px;
}

.filter-btn {
    background: none;
    border: none;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6B7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: #FFFFFF;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Customer Cards Grid */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 28px;
    padding-bottom: 40px;
}

.customer-card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.customer-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cust-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #4F46E5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.cust-basic-info {
    flex-grow: 1;
}

.cust-basic-info h4 {
    font-size: 1.15rem;
    color: #111827;
    margin-bottom: 4px;
    font-weight: 600;
}

.cust-basic-info span {
    font-size: 0.85rem;
    color: #6B7280;
}

.tag {
    background-color: #F3F4F6;
    color: #4B5563;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid #E5E7EB;
}

/* Metrics Grid */
.metrics-grid {
    display: flex;
    justify-content: space-between;
    background-color: #F9FAFB;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #F3F4F6;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.metric .label {
    font-size: 0.75rem;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.metric .value {
    font-size: 1.25rem;
    color: #111827;
    font-weight: 800;
}

/* WASM Score Area */
.wasm-score-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.score-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.score-value {
    color: #6366F1;
    font-weight: 800;
}

.gauge-container {
    width: 100%;
    height: 10px;
    background-color: #F3F4F6;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    border-radius: 5px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* AI Insight Box */
.ai-insight-box {
    background: linear-gradient(145deg, #FDFBFF, #F5F3FF);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ai-insight-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(to bottom, #8B5CF6, #D8B4FE);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #7C3AED;
    margin-bottom: 10px;
}

.insight-content p {
    font-size: 0.9rem;
    color: #4B5563;
    line-height: 1.6;
}

.placeholder-text {
    font-style: italic;
    color: #9CA3AF !important;
}

/* Card Footer */
.card-footer {
    margin-top: auto;
}

.btn-ai-analyze {
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #374151;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-ai-analyze:hover {
    border-color: #8B5CF6;
    color: #7C3AED;
    background-color: #F5F3FF;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(139, 92, 246, 0.1);
}

.btn-ai-analyze:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.05);
}

/* AI Loading Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ai-processing {
    background: rgba(255, 255, 255, 0.95);
    padding: 48px;
    border-radius: 24px;
    text-align: center;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-processing h3 {
    font-size: 1.5rem;
    color: #1F2937;
    font-weight: 800;
    background: linear-gradient(135deg, #4F46E5, #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-processing p {
    font-size: 0.95rem;
    color: #6B7280;
    line-height: 1.6;
}

/* Hexagon CSS Loader */
.hexagon-loader {
    width: 70px;
    height: 70px;
    position: relative;
    animation: rotate-loader 3s linear infinite;
    margin-bottom: 10px;
}

.hex {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366F1, #D8B4FE);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: pulse-hex 1.5s infinite alternate ease-in-out;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

@keyframes rotate-loader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-hex {
    0% { transform: scale(0.8); opacity: 0.7; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* Responsiveness */
@media (max-width: 1200px) {
    .customer-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    .logo-text, .nav-item span, .user-info {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 16px;
    }
    .top-header {
        padding: 0 20px;
    }
    .header-search {
        width: 200px;
    }
    .ai-status span {
        display: none;
    }
    .ai-status {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    .status-dot {
        margin: 0;
    }
    .content-wrapper {
        padding: 16px 20px; /* Refined mobile padding for spacious feeling */
    }
}
```