/**
 * Kuma Chat - Linear Style Theme
 * 深色画布 + 薰衣草蓝强调
 */

:root {
    --bg-primary: #010102;
    --bg-secondary: #0a0a0f;
    --bg-tertiary: #111118;
    --bg-card: #14141f;
    --bg-hover: #1a1a2e;
    --bg-active: #1e1e35;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b5;
    --text-tertiary: #6b6b80;
    --text-muted: #4a4a5a;

    --accent: #8B5CF6;
    --accent-hover: #7C3AED;
    --accent-light: rgba(139, 92, 246, 0.15);
    --accent-glow: rgba(139, 92, 246, 0.3);

    --success: #34D399;
    --warning: #FBBF24;
    --danger: #EF4444;
    --info: #60A5FA;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ============ Layout ============ */

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 72px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #EC4899);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    margin-bottom: 24px;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sidebar-item {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.sidebar-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.sidebar-item .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: var(--radius-full);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Panel Layout */
.panel {
    width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ============ Form Elements ============ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6b80' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

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

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--success);
    color: #010102;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-full {
    width: 100%;
}

/* ============ Cards ============ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 20px;
}

/* ============ Auth Pages ============ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
    animation: authBg 20s ease-in-out infinite;
}

@keyframes authBg {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-5%, 5%); }
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #EC4899);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============ Chat Layout ============ */

.chat-container {
    display: flex;
    height: 100vh;
}

.chat-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.chat-item:hover {
    background: var(--bg-hover);
}

.chat-item.active {
    background: var(--accent-light);
}

.chat-item .avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-item .info {
    flex: 1;
    min-width: 0;
}

.chat-item .name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-item .preview {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-item .meta {
    text-align: right;
    flex-shrink: 0;
}

.chat-item .time {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-item .unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: var(--radius-full);
    font-size: 10px;
    color: white;
    margin-top: 4px;
    padding: 0 5px;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.chat-header .title {
    font-size: 16px;
    font-weight: 600;
}

.chat-header .subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
}

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

.chat-header-actions button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-header-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 70%;
    animation: msgIn 0.2s ease-out;
}

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

.message.self {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message .msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    flex-shrink: 0;
    overflow: hidden;
}

.message .msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message .msg-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message .msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.message .msg-name {
    font-weight: 500;
    color: var(--text-secondary);
}

.message .msg-time {
    color: var(--text-muted);
}

.message .msg-bubble {
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.message.self .msg-bubble {
    background: var(--accent);
    color: white;
}

.message .msg-bubble.recalled {
    color: var(--text-muted);
    font-style: italic;
}

.message.system {
    justify-content: center;
    max-width: 100%;
}

.message.system .msg-bubble {
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 12px;
}

/* Chat Input */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: var(--accent-hover);
}

/* ============ Right Panel ============ */

.right-panel {
    width: 320px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.profile-section {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    margin: 0 auto 16px;
    overflow: hidden;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .frame-overlay {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    pointer-events: none;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-signature {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.profile-stat {
    text-align: center;
}

.profile-stat .value {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.profile-stat .label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============ Groups ============ */

.group-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.group-card:hover {
    background: var(--bg-hover);
}

.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #EC4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}

.group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============ Modals ============ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============ Tabs ============ */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============ Badge & Tags ============ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============ Empty State ============ */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* ============ Settings ============ */

.settings-group {
    margin-bottom: 24px;
}

.settings-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.settings-item .label {
    font-size: 14px;
}

.settings-item .desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* ============ Shop ============ */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.shop-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.shop-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.shop-item .preview {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.shop-item .item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.shop-item .item-price {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.shop-item .item-rarity {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Rarity colors */
.rarity-1 { color: var(--text-secondary); }
.rarity-2 { color: var(--success); }
.rarity-3 { color: var(--accent); }
.rarity-4 { color: var(--warning); }

/* ============ Admin ============ */

.admin-layout {
    display: flex;
    height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.admin-nav {
    flex: 1;
    padding: 12px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    font-size: 14px;
}

.admin-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.admin-header {
    margin-bottom: 24px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-card .stat-change.positive { color: var(--success); }
.stat-card .stat-change.negative { color: var(--danger); }

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--bg-hover);
}

/* ============ Utilities ============ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-tertiary); }
.font-bold { font-weight: 600; }
.hidden { display: none; }

/* ============ Animations ============ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-fade { animation: fadeIn 0.3s ease-out; }
.animate-slide { animation: slideUp 0.3s ease-out; }

/* ============ Responsive ============ */

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .panel { width: 100%; }
    .right-panel { display: none; }
    .chat-sidebar { width: 100%; }
}
