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

        body {
            font-family: 'Segoe UI', sans-serif;
            background: #0f172a;
            color: #e2e8f0;
            height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* Header */
        .header {
            background: linear-gradient(135deg, #1e293b, #0f172a);
            padding: 16px 24px;
            border-bottom: 1px solid #334155;
            display: flex;
            align-items: center;
            justify-content: space-between; 
        }

        .header h1 {
            font-size: 1.1em;
            color: #38bdf8;
        }

        .header .badge {
            background: #22c55e;
            color: #0f172a;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 0.75em;
            font-weight: 700;
        }

        /* Main layout */
        .main {
            flex: 1;
            display: grid;
            grid-template-columns: 1fr 400px;
            overflow: hidden;
            min-height: 0;
        }

        /* Chat area */
        .chat-container {
            display: flex;
            flex-direction: column;
            border-right: 1px solid #334155;
            min-height: 0;
        }

        .messages {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        .msg {
            margin-bottom: 16px;
            max-width: 85%;
        }

        .msg-user {
            margin-left: auto;
        }

        .msg-bot {
            margin-right: auto;
        }

        .msg-bubble {
            padding: 12px 16px;
            border-radius: 16px;
            line-height: 1.6;
            font-size: 0.9em;
            white-space: pre-wrap;
        }

        .msg-user .msg-bubble {
            background: #3b82f6;
            color: white;
            border-bottom-right-radius: 4px;
        }

        .msg-bot .msg-bubble {
            background: #1e293b;
            border: 1px solid #334155;
            border-bottom-left-radius: 4px;
        }

        .msg-label {
            font-size: 0.7em;
            color: #64748b;
            margin-bottom: 4px;
            padding: 0 8px;
        }

        .msg-user .msg-label {
            text-align: right;
        }

        /* Input */
        .input-area {
            padding: 16px;
            border-top: 1px solid #334155;
            display: flex;
            gap: 10px;
        }

        .input-area input {
            flex: 1;
            padding: 12px 16px;
            background: #1e293b;
            border: 1px solid #475569;
            border-radius: 12px;
            color: #e2e8f0;
            font-size: 0.95em;
        }

        .input-area input:focus {
            outline: none;
            border-color: #38bdf8;
        }

        .input-area button {
            padding: 12px 24px;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            border: none;
            border-radius: 12px;
            color: white;
            font-weight: 600;
            cursor: pointer;
        }

        .input-area button:hover {
            opacity: 0.9;
        }

        .input-area button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Side panel */
        .side-panel {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            min-height: 0;
        }

        .side-tabs {
            display: flex;
            border-bottom: 1px solid #334155;
        }

        .side-tab {
            flex: 1;
            padding: 10px;
            text-align: center;
            font-size: 0.8em;
            font-weight: 600;
            color: #64748b;
            cursor: pointer;
            border-bottom: 2px solid transparent;
        }

        .side-tab.active {
            color: #38bdf8;
            border-bottom-color: #38bdf8;
        }

        .side-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        /* SQL display */
        .sql-box {
            background: #0f172a;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 12px;
            font-family: 'Cascadia Code', monospace;
            font-size: 0.78em;
            color: #a5f3fc;
            white-space: pre-wrap;
            word-break: break-all;
            line-height: 1.5;
            margin-bottom: 12px;
        }

        /* Timing */
        .timing-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 16px;
        }

        .timing-card {
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 10px;
            text-align: center;
        }

        .timing-card .label {
            font-size: 0.7em;
            color: #64748b;
        }

        .timing-card .value {
            font-size: 1.2em;
            font-weight: bold;
            color: #fbbf24;
        }

        /* Product cards */
        .product-mini {
            display: flex;
            gap: 10px;
            padding: 10px;
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            margin-bottom: 8px;
        }

        .product-mini img {
            width: 60px;
            height: 60px;
            object-fit: contain;
            border-radius: 6px;
            background: #fff;
        }

        .product-mini .info {
            flex: 1;
        }

        .product-mini .name {
            font-size: 0.85em;
            font-weight: 600;
            color: #f1f5f9;
        }

        .product-mini .code {
            font-size: 0.75em;
            color: #38bdf8;
            font-family: monospace;
        }

        .product-mini .price {
            font-size: 0.85em;
            color: #f97316;
            font-weight: bold;
            margin-top: 2px;
        }

        .loading-dots::after {
            content: '';
            animation: dots 1.5s infinite;
        }

        @keyframes dots {

            0%,
            20% {
                content: '.';
            }

            40% {
                content: '..';
            }

            60%,
            100% {
                content: '...';
            }
        }

        .empty-hint {
            text-align: center;
            color: #475569;
            padding: 40px 20px;
        }

        .empty-hint .icon {
            font-size: 2.5em;
            margin-bottom: 8px;
        }

        .suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-top: 16px;
        }

        .suggestions button {
            background: #1e293b;
            border: 1px solid #475569;
            color: #94a3b8;
            padding: 6px 14px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.8em;
        }

        .suggestions button:hover {
            border-color: #38bdf8;
            color: #38bdf8;
        }