/* =========================================
   Base Resets & Variables
========================================= */
:root {
    --bg-base: #06090e;
    --bg-surface: #101520;
    --bg-surface-glass: rgba(16, 21, 32, 0.7);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #10b981; /* Shifted to Teal/Green for "Munshi/Money" vibe */
    --accent-secondary: #059669;
    --accent-cyan: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
}

/* =========================================
   Layout & Structural
========================================= */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 270px;
    background-color: var(--bg-surface);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 10;
}

.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    position: relative;
    background: radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 35%),
                radial-gradient(circle at 0% 100%, rgba(14, 165, 233, 0.05) 0%, transparent 35%);
}

/* =========================================
   Sidebar Elements
========================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    background: var(--bg-surface);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-glow);
}

.brand h1 {
    font-size: 24px;
    letter-spacing: -0.5px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    display: block;
    padding: 0 24px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item i {
    font-size: 18px;
    opacity: 0.8;
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    border-left-color: var(--accent-primary);
}

.nav-item.active i {
    color: var(--accent-primary);
    opacity: 1;
}

.user-profile {
    padding: 24px;
    border-top: var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

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

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-location {
    font-size: 12px;
    color: var(--text-secondary);
}

/* =========================================
   Main Area Header Elements
========================================= */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.header-title h2 {
    font-size: 28px;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 13px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-base);
}

.btn-primary:hover {
    background: #e4e4e7;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.btn-gradient {
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-gradient:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.mini-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
}

.mini-btn:hover { background: rgba(255,255,255,0.2); }
.mt-2 { margin-top: 8px; }

.warning-btn { background: rgba(245, 158, 11, 0.2); border-color: rgba(245, 158, 11, 0.3); color: #fcd34d; }
.warning-btn:hover { background: rgba(245, 158, 11, 0.3); }

.accent-btn { background: rgba(14, 165, 233, 0.2); border-color: rgba(14, 165, 233, 0.3); color: #7dd3fc; }
.accent-btn:hover { background: rgba(14, 165, 233, 0.3); }


/* =========================================
   Glassmorphism Cards
========================================= */
.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

/* =========================================
   Grid Layouts
========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.content-row {
    display: flex;
    gap: 24px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* =========================================
   Smart Summary & Recommendations
========================================= */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 24px;
    gap: 16px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gradient-box {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(0,0,0,0.2) 100%);
    border-color: rgba(16, 185, 129, 0.2);
    position: relative;
    overflow: hidden;
}

.gradient-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-family: var(--font-heading);
    font-weight: 700;
}

.highlight {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.success {
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.success-badge {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.icon-warning { color: var(--warning); }

.recommendation-content {
    padding: 24px;
}

.plan-overview {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.platform-split {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 2px;
}

.split-details {
    display: flex;
    flex-direction: column;
}

.platform-name {
    font-weight: 600;
    font-size: 14px;
}

.platform-items {
    font-size: 12px;
    color: var(--text-secondary);
}

.split-divider {
    padding: 0 16px;
    color: var(--text-muted);
}

/* =========================================
   Tables & Filters
========================================= */
.filter-group {
    display: flex;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.data-table th {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-img {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.product-name {
    font-weight: 500;
}

.product-details {
    font-size: 12px;
    color: var(--text-secondary);
}

.price-high {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.price-high span {
    display: block;
    font-size: 11px;
    text-decoration: none;
}

.decision-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.decision-bubble img {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.decision-bubble span {
    font-weight: 600;
    color: var(--success);
}

.insight-chip {
    display: inline-flex;
    margin-left: 8px;
    font-size: 10px;
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 4px;
}

/* =========================================
   Alerts List
========================================= */
.alerts-list {
    padding: 16px;
}

.alert-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    border: 1px solid transparent;
    transition: transform 0.2s;
}

.alert-item:hover {
    transform: translateX(4px);
}

.alert-icon {
    font-size: 20px;
    margin-top: -2px;
}

.alert-content h4 {
    font-size: 13px;
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.drop-alert {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.1);
}
.drop-alert .alert-icon { color: var(--success); }

.insight-alert {
    background: var(--warning-bg);
    border-color: rgba(245, 158, 11, 0.1);
}
.insight-alert .alert-icon { color: var(--warning); }

.stock-alert {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.1);
}
.stock-alert .alert-icon { color: var(--danger); }

.delivery-alert {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}
.delivery-alert .alert-icon { color: #0ea5e9; }

/* Processing Animation */
.processing {
    animation: pulse 1.5s infinite;
}

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

/* =========================================
   Autocomplete Search
========================================= */
.search-wrapper {
    position: relative;
    display: inline-block;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#product-search {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 10px 16px 10px 40px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    width: 320px;
    transition: all 0.2s;
}

#product-search:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
    text-align: left;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(255,255,255,0.05);
}

.search-item-img {
    font-size: 20px;
}

.search-item-details {
    display: flex;
    flex-direction: column;
}

.search-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.search-item-brand {
    font-size: 11px;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
