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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background-color: #f7f8fa;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Layout Containers */
.container {
    display: grid;
    grid-template-areas:
        "header header header"
        "sidebar main preview"
        "footer footer footer";
    grid-template-rows: 60px 1fr 30px;
    grid-template-columns: 240px 1fr 320px;
    height: 100%;
}

/* Header */
.header {
    grid-area: header;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid #e5e6eb;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 32px;
    height: 32px;
    background: #1d61ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.sys-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #eee;
}

.shop-name {
    font-size: 14px;
    color: #4e5969;
}

.logout-btn {
    font-size: 14px;
    color: #f53f3f;
    cursor: pointer;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid #e5e6eb;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    gap: 12px;
    color: #4e5969;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.menu-item:hover, .menu-item.active {
    background: #f2f3f5;
    color: #1d61ff;
}

.menu-item i {
    font-size: 18px;
}

/* Main Area (Chat) */
.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

.chat-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.welcome-box {
    text-align: center;
    padding: 40px 0;
}

.welcome-box h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.welcome-box p {
    color: #86909c;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.message.ai {
    align-self: flex-start;
    background: #f2f3f5;
    color: #1d2129;
    border-bottom-left-radius: 2px;
}

.message.user {
    align-self: flex-end;
    background: #1d61ff;
    color: white;
    border-bottom-right-radius: 2px;
}

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid #e5e6eb;
    background: #fff;
}

.input-box-wrapper {
    background: #f2f3f5;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-box-wrapper textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 60px;
}

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

.action-left {
    display: flex;
    gap: 12px;
}

.action-btn {
    cursor: pointer;
    color: #4e5969;
    font-size: 20px;
}

.send-btn {
    background: #1d61ff;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

/* Preview Area */
.preview {
    grid-area: preview;
    background: #f7f8fa;
    border-left: 1px solid #e5e6eb;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.preview-header {
    font-weight: 600;
    font-size: 16px;
    color: #1d2129;
    margin-bottom: 12px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.task-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00b42a;
}

/* Footer */
.footer {
    grid-area: footer;
    background: #fff;
    border-top: 1px solid #e5e6eb;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #86909c;
}

/* Page Content Specifics */
.page-content {
    display: none; /* Hidden by default, shown when active */
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

.page-content.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e6eb;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-top: 8px;
}

.btn-primary {
    background: #1d61ff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.table th, .table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #f2f3f5;
}

.table th {
    background: #f7f8fa;
    color: #4e5969;
    font-weight: 500;
}
