:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f1f5f9;
    --sidebar-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.9);
    --sidebar-width: 260px;
    --ai-width: 350px;
    --radius: 16px;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: #1e293b;
    letter-spacing: -0.01em;
    overflow: hidden;
}

#wrapper {
    display: flex;
    height: 100vh;
}

/* Sidebar Modernissima */
#sidebar-wrapper {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-heading {
    padding: 2rem 1.5rem;
    background: linear-gradient(to bottom, rgba(37, 99, 235, 0.1), transparent);
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

#sidebar-wrapper .list-group-item {
    border: none;
    background: transparent !important;
    color: #94a3b8;
    padding: 0.75rem 1.5rem;
    margin: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-wrapper .list-group-item svg {
    margin-right: 12px;
    opacity: 0.7;
}

#sidebar-wrapper .list-group-item:hover {
    color: white;
    background: rgba(255,255,255,0.05) !important;
}

#sidebar-wrapper .list-group-item.active {
    color: white;
    background: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Page Content & Glassmorphism */
#page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: var(--background);
}

.navbar {
    background: rgba(248, 250, 252, 0.9) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0 !important;
    position: sticky;
    top: 0;
    z-index: 50;
}

#ai-sidebar {
    width: var(--ai-width);
    height: 100vh;
    background: white;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

body.ai-closed #ai-sidebar {
    width: 0;
    border-left: 0;
    opacity: 0;
}

.product-img-container {
    width: 100%;
    height: 180px;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid #f1f5f9;
}

.product-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.stat-card:hover .product-img-container img {
    transform: scale(1.05);
}

.btn-white {
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--secondary);
}

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

.product-list-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 15px;
    border: 1px solid #f1f5f9;
}

.ai-header {
    background: #f8fafc;
    color: #1e293b;
    padding: 1.25rem;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fdfdfd;
}

.msg-bubble {
    padding: 0.8rem 1.1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    max-width: 85%;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ai-msg .msg-bubble {
    background: #f1f5f9;
    color: #334155;
    border-bottom-left-radius: 4px;
}

.user-msg .msg-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-input-area {
    padding: 1.25rem;
    background: white;
}

.ai-input-container {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.4rem;
    display: flex;
}

/* Animations */
.content-view {
    animation: fadeIn 0.4s ease-out;
}

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

/* Tables */
.table {
    --bs-table-hover-bg: #f8fafc;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--secondary);
    border: none;
}

.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bg-pending { background: #fffbeb; color: #b45309; }
.bg-shipped { background: #f0fdf4; color: #15803d; }
.bg-delivered { background: #eff6ff; color: #1d4ed8; }
.bg-cancelled { background: #fef2f2; color: #b91c1c; }

.highlight-row {
    animation: highlightRow 2s ease-out;
}

@keyframes highlightRow {
    0% { background: rgba(37, 99, 235, 0.1); border-left: 4px solid var(--primary); }
    100% { background: transparent; border-left: 0px solid var(--primary); }
}

@media (max-width: 1200px) {
    #ai-sidebar {
        display: none; /* Hide for now on small screens */
    }
}

/* Voice Animation */
.mic-pulsing {
    color: var(--danger) !important;
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}
