@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2D68FF;
    --primary-light: #EEF4FF;
    --bg-main: #F8FAFC;
    --sidebar-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background: var(--bg-main); color: var(--text-main); }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo { font-size: 22px; font-weight: 800; margin-bottom: 30px; line-height: 1; }
.logo span { color: var(--primary); }
.logo-subtitle { 
    display: block; 
    font-size: 10px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--text-muted); 
    margin-top: 6px; 
    font-weight: 700;
}

.nav-menu { flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.nav-item i { width: 20px; }
.nav-item:hover, .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer { font-size: 12px; color: var(--text-muted); text-align: center; }

/* Main Content */
.main-content { margin-left: 260px; flex: 1; padding: 30px 40px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.search-box {
    background: var(--white);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 400px;
}

.search-box input { border: none; outline: none; flex: 1; font-size: 14px; }
.search-box i { color: var(--text-muted); }

.user-profile { display: flex; align-items: center; gap: 15px; }
.user-profile img { width: 40px; height: 40px; border-radius: 50%; }
.admin-info { line-height: 1.2; }
.admin-info strong { display: block; font-size: 14px; }
.admin-info span { font-size: 12px; color: var(--text-muted); }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-header h1 { font-size: 24px; font-weight: 800; }
.date-picker { background: var(--white); padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; cursor: pointer; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
.stat-card { background: var(--white); padding: 24px; border-radius: 20px; border: 1px solid var(--border); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; justify-content: center; align-items: center; font-size: 24px; }

.stat-icon.blue { background: #EEF4FF; color: #2D68FF; }
.stat-icon.green { background: #ECFDF5; color: #10B981; }
.stat-icon.purple { background: #F5F3FF; color: #8B5CF6; }
.stat-icon.orange { background: #FFF7ED; color: #F59E0B; }

.stat-info p { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-info h3 { font-size: 22px; font-weight: 800; }
.trend { font-size: 12px; font-weight: 700; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* Charts & Activity */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 40px; }
.chart-container, .activity-container { background: var(--white); padding: 24px; border-radius: 24px; border: 1px solid var(--border); }

.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.chart-actions { display: flex; gap: 15px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

.activity-list { margin-top: 20px; }
.activity-item { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border: none; }
.activity-item img { width: 45px; height: 45px; border-radius: 10px; object-fit: cover; }
.activity-info h4 { font-size: 14px; font-weight: 700; }
.activity-info p { font-size: 12px; color: var(--text-muted); }

.view-all { display: block; text-align: center; color: var(--primary); font-weight: 700; font-size: 14px; margin-top: 20px; text-decoration: none; }

/* Tables */
.table-section { background: var(--white); padding: 24px; border-radius: 24px; border: 1px solid var(--border); }
.table-header { margin-bottom: 20px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 16px; font-size: 13px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid var(--bg-main); }
.admin-table td { padding: 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); }

.user-td { display: flex; align-items: center; gap: 10px; }
.user-td img { width: 32px; height: 32px; border-radius: 50%; }

.badge { padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge.active { background: #ECFDF5; color: #059669; }
.badge.pending { background: #FFF7ED; color: #D97706; }
.badge.idle { background: #F3F4F6; color: #6B7280; }

.prop-td { display: flex; align-items: center; gap: 12px; }
.prop-td img { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; }
.prop-td div { line-height: 1.3; }
.prop-td strong { display: block; font-size: 14px; }
.prop-td span { font-size: 12px; color: var(--text-muted); }

.actions-td { display: flex; gap: 8px; }
.act-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.act-btn.edit { background: var(--primary-light); color: var(--primary); }
.act-btn.delete { background: #FEF2F2; color: var(--danger); }
.act-btn.approve { background: #ECFDF5; color: var(--success); }
.act-btn:hover { transform: scale(1.1); }

.header-actions { display: flex; gap: 12px; }
.filter-btn-admin, .add-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-btn-admin { background: var(--white); border: 1px solid var(--border); color: var(--text-main); }
.add-btn { background: var(--primary); color: var(--white); }

.role-badge { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.role-badge.seller { background: #F5F3FF; color: #7C3AED; }
.role-badge.buyer { background: #EFF6FF; color: #2563EB; }
.role-badge.admin { background: #FFFBEB; color: #D97706; }

/* Analytics Grid */
.charts-grid-analytics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.chart-card { background: var(--white); padding: 24px; border-radius: 20px; border: 1px solid var(--border); }
.chart-card h3 { font-size: 16px; margin-bottom: 20px; color: var(--text-muted); }

/* Support Section */
.support-container { display: grid; grid-template-columns: 350px 1fr; background: var(--white); border-radius: 24px; border: 1px solid var(--border); min-height: 600px; overflow: hidden; }
.inbox-list { border-right: 1px solid var(--border); }
.inbox-header { padding: 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.ticket-item { padding: 20px 25px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.3s; }
.ticket-item:hover, .ticket-item.active { background: var(--primary-light); }
.ticket-status { width: 8px; height: 8px; border-radius: 50%; }
.ticket-status.open { background: var(--success); }
.ticket-status.closed { background: var(--danger); }

.chat-viewport { display: flex; flex-direction: column; }
.chat-header { padding: 20px 30px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.user-meta { display: flex; align-items: center; gap: 15px; }
.user-meta img { width: 40px; height: 40px; border-radius: 50%; }
.chat-messages { flex: 1; padding: 30px; display: flex; flex-direction: column; gap: 15px; background: #F8FAFC; }
.msg { padding: 12px 20px; border-radius: 18px; max-width: 70%; font-size: 14px; font-weight: 500; }
.msg.received { background: var(--white); align-self: flex-start; border: 1px solid var(--border); }
.msg.sent { background: var(--primary); color: var(--white); align-self: flex-end; }
.chat-input { padding: 20px 30px; border-top: 1px solid var(--border); display: flex; gap: 15px; }
.chat-input input { flex: 1; border: none; outline: none; font-size: 14px; }
.resolve-btn { padding: 8px 16px; background: #ECFDF5; color: #059669; border: none; border-radius: 10px; font-weight: 700; cursor: pointer; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.settings-card { background: var(--white); padding: 30px; border-radius: 20px; border: 1px solid var(--border); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.form-group input { width: 100%; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); outline: none; font-weight: 600; }
.secondary-btn { padding: 10px 18px; background: var(--bg-main); border: 1px solid var(--border); border-radius: 10px; font-weight: 700; cursor: pointer; }

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
}
