/* ========== PENNYLANE STYLE - VARIABLES ========== */
:root {
    --mint-50: #f0fdf9;
    --mint-100: #ccfbef;
    --mint-200: #99f6e0;
    --mint-300: #5fe9d0;
    --mint-400: #2dd4bf;
    --mint-500: #14b8a6;
    --mint-600: #0d9488;
    --mint-700: #0f766e;
    --dark-900: #0c2e2a;
    --dark-800: #134e4a;
    --dark-700: #115e59;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-900: #171717;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--mint-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== LAYOUT ========== */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== HEADER ========== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--dark-900);
}

.logo-circle {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--mint-600);
}

.btn-profile {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.btn-upload {
    padding: 12px 24px;
    background: var(--dark-900);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-upload:hover {
    background: var(--dark-800);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 46, 42, 0.3);
}

/* ========== MAIN LAYOUT (2 COLONNES) ========== */
.main-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    padding: 24px 0;
    align-items: start;
}

/* ========== SIDEBAR (Stats + Actions) ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 110px;
    align-self: start;
}

/* ========== STATS CARDS (COMPACT) ========== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--mint-300);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.12);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark-900);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-unit {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-600);
    margin-left: 4px;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    background: var(--mint-100);
    color: var(--mint-700);
}

.stat-change.negative {
    background: #fee2e2;
    color: #991b1b;
}

/* ========== QUICK ACTIONS (COMPACT) ========== */
.quick-actions {
    background: white;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--gray-200);
}

.quick-actions h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-900);
    margin-bottom: 16px;
}

.actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.action-btn:hover {
    background: var(--mint-50);
    border-color: var(--mint-300);
    transform: translateX(4px);
}

.action-btn-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.action-btn-content {
    flex: 1;
}

.action-btn-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-900);
    margin-bottom: 2px;
}

.action-btn-desc {
    font-size: 12px;
    color: var(--gray-600);
}

/* ========== INSIGHTS (COMPACT) ========== */
.insights-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-mini {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border-left: 3px solid;
    border-top: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.2s;
    cursor: pointer;
}

.insight-mini:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.insight-mini.economy { border-left-color: var(--mint-500); }
.insight-mini.alert { border-left-color: #f59e0b; }
.insight-mini.opportunity { border-left-color: #6366f1; }

.insight-mini-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-900);
    margin-bottom: 4px;
}

.insight-mini-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--mint-600);
    margin-bottom: 4px;
}

.insight-mini-desc {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
}

/* ========== CHAT PRINCIPAL (DOMINANT) ========== */
.chat-main {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 700px;
}

.chat-container {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 20px 32px;
    background: linear-gradient(135deg, var(--mint-50), white);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark-900);
    margin-bottom: 4px;
}

.chat-subtitle {
    font-size: 14px;
    color: var(--gray-600);
}

.chat-messages {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--mint-300);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--mint-400);
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.message.pacioli .message-avatar {
    background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
    color: white;
}

.message.user .message-avatar {
    background: var(--dark-900);
    color: white;
}

.message-bubble {
    padding: 18px 22px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.7;
}

.message.pacioli .message-bubble {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    color: var(--gray-900);
}

.message.user .message-bubble {
    background: var(--dark-900);
    color: white;
}

/* Quick suggestions */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--mint-300);
    border-radius: 20px;
    font-size: 13px;
    color: var(--mint-700);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: var(--mint-500);
    color: white;
    transform: translateY(-2px);
}

.chat-input-container {
    padding: 20px 32px;
    border-top: 1px solid var(--gray-200);
    background: white;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 16px 24px;
    border: 2px solid var(--gray-300);
    border-radius: 14px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.chat-input:focus {
    border-color: var(--mint-400);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.btn-send {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--mint-500), var(--mint-600));
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.3);
}

.btn-send:active {
    transform: translateY(0);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--mint-400);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        grid-row: 2;
    }

    .chat-main {
        height: 70vh;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .message {
        max-width: 90%;
    }

    .nav-menu {
        gap: 16px;
    }

    .nav-link {
        display: none;
    }
}
