/* Modern Dashboard Styles - Innap Style */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --primary: #4F46E5;
    --primary-light: #818CF8;
    --primary-dark: #3730A3;
    --success: #10B981;
    --success-light: #34D399;
    --warning: #F59E0B;
    --warning-light: #FBBF24;
    --danger: #EF4444;
    --danger-light: #F87171;
    --info: #3B82F6;
    --info-light: #60A5FA;
    
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--gray-200);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    padding: 0 12px;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.nav-item.active .nav-icon {
    color: #fff;
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    color: var(--gray-500);
    transition: color 0.2s;
}

.nav-item:hover .nav-icon {
    color: var(--gray-700);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-user:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

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

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.user-dropdown-icon {
    color: var(--gray-400);
    font-size: 0.75rem;
}

/* ========== MAIN WRAPPER ========== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ========== HEADER ========== */
.header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 1.25rem;
    cursor: pointer;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 320px;
    padding: 10px 16px 10px 44px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: var(--gray-50);
    transition: all 0.2s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.header-search input::placeholder {
    color: var(--gray-400);
}

.header-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
}

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

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    transition: all 0.2s;
    position: relative;
    color: var(--gray-600);
}

.header-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.btn-logout {
    padding: 10px 20px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    padding: 32px;
}

/* ========== SECTIONS ========== */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* ========== STATS CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.gradient-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    color: #fff;
}

.stat-card.gradient-green {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: #fff;
}

.stat-card.gradient-orange {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: #fff;
}

.stat-card.gradient-red {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    color: #fff;
}

.stat-card.gradient-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
    color: #fff;
}

.stat-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.stat-card-change {
    margin-top: 12px;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-grid-equal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* ========== CARDS ========== */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

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

.card-body {
    padding: 24px;
}

.card-body-flush {
    padding: 0;
}

/* ========== CHART CONTAINER ========== */
.chart-container {
    height: 300px;
    position: relative;
}

/* ========== PROJECTS LIST ========== */
.projects-list {
    display: flex;
    flex-direction: column;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-item:last-child {
    border-bottom: none;
}

.project-item:hover {
    background: var(--gray-50);
}

.project-item.selected {
    background: rgba(79, 70, 229, 0.05);
    border-left: 3px solid var(--primary);
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.project-icon.blue { background: linear-gradient(135deg, var(--info) 0%, var(--info-light) 100%); color: #fff; }
.project-icon.green { background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%); color: #fff; }
.project-icon.orange { background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%); color: #fff; }
.project-icon.red { background: linear-gradient(135deg, var(--danger) 0%, var(--danger-light) 100%); color: #fff; }
.project-icon.purple { background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%); color: #fff; }

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

.project-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-domain {
    font-size: 0.8125rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-item:hover .project-actions {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--gray-200);
}

.project-stats {
    text-align: right;
    flex-shrink: 0;
}

.project-products-count {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
}

.project-searches-count {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

/* ========== DONUT CHART ========== */
.donut-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 20px;
}

.donut-chart {
    position: relative;
    width: 140px;
    height: 140px;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-chart circle {
    fill: none;
    stroke-width: 20;
}

.donut-chart .donut-bg {
    stroke: var(--gray-200);
}

.donut-chart .donut-fill {
    stroke: var(--primary);
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.donut-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-text {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.legend-value {
    font-weight: 600;
    margin-left: auto;
    color: var(--gray-800);
}

/* ========== POPULAR QUERIES ========== */
.queries-list {
    display: flex;
    flex-direction: column;
}

.query-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.2s;
}

.query-item:last-child {
    border-bottom: none;
}

.query-item:hover {
    background: var(--gray-50);
}

.query-rank {
    width: 28px;
    height: 28px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-right: 14px;
}

.query-rank.top {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
    color: #fff;
}

.query-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.query-count {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ========== SECTION HEADER ========== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.section-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.section-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

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

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

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== SELECT ========== */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper select {
    appearance: none;
    padding: 10px 40px 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: #fff;
    cursor: pointer;
    min-width: 200px;
    color: var(--gray-700);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6875rem;
    color: var(--gray-400);
    pointer-events: none;
}

.select-wrapper.select-sm select {
    padding: 6px 28px 6px 12px;
    font-size: 0.8125rem;
    min-width: 100px;
}

.select-wrapper.select-sm::after {
    right: 10px;
    font-size: 0.5rem;
}

/* ========== FEED PANEL ========== */
.feed-panel {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.feed-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.feed-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.feed-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.success { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--danger); }
.status-dot.neutral { background: var(--gray-400); }

.feed-url-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.feed-url-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
}

.feed-url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.feed-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.feed-stat {
    text-align: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.feed-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.feed-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========== TABLE ========== */
.table-container {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-title {
    font-weight: 600;
    color: var(--gray-800);
}

.table-search {
    position: relative;
}

.table-search input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    width: 280px;
    background: var(--gray-50);
}

.table-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.table-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

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

.data-table th {
    background: var(--gray-50);
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.data-table tbody tr {
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

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

.product-cell {
    display: flex;
    align-items: center;
    gap: 14px;
}

.product-image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.product-image-placeholder {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.product-name {
    font-weight: 500;
    color: var(--gray-800);
}

.product-price {
    font-weight: 600;
    color: var(--primary);
}

.product-category {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--gray-100);
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.page-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0 12px;
}

/* ========== WIDGET SETTINGS ========== */
.widget-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.settings-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-800);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    color: var(--gray-800);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: #fff;
    color: var(--gray-800);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.checkbox-item:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Synonyms */
.synonyms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.synonym-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.synonym-words {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.synonym-word {
    padding: 4px 10px;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    font-size: 0.875rem;
}

.synonym-delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.synonym-delete-btn:hover {
    background: var(--danger);
    color: #fff;
}

.synonym-input-row {
    display: flex;
    gap: 12px;
}

.synonym-input-row .form-input {
    flex: 1;
}

.synonym-add-form {
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.color-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-input {
    width: 48px;
    height: 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 2px;
}

.color-value {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: monospace;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range-input {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-200);
    border-radius: 3px;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.range-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-group label {
    font-size: 0.9375rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* ========== WIDGET PREVIEW ========== */
.preview-container {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-radius: var(--radius-lg);
    padding: 40px;
    min-height: 500px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.preview-widget {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-xl);
}

.preview-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.preview-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.preview-search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.preview-search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.preview-search-box button {
    padding: 12px 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}

.preview-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-result-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.preview-result-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
}

.preview-result-img {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.preview-result-info {
    flex: 1;
    min-width: 0;
}

.preview-result-title {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-result-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
}

/* ========== EMBED SECTION ========== */
.embed-section {
    margin-bottom: 24px;
}

.api-key-box {
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.api-key-label {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-bottom: 4px;
}

.api-key-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--success);
    word-break: break-all;
}

.btn-copy {
    background: var(--gray-700);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--gray-600);
}

.code-block {
    background: var(--gray-900);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.code-block-header {
    padding: 12px 20px;
    background: var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block-title {
    font-size: 0.8125rem;
    color: var(--gray-400);
    font-weight: 500;
}

.code-block pre {
    padding: 20px;
    color: var(--gray-100);
    font-size: 0.875rem;
    overflow-x: auto;
    line-height: 1.7;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.code-block code {
    font-family: inherit;
}

.code-string { color: #A5D6FF; }
.code-keyword { color: #FF7B72; }
.code-attr { color: #79C0FF; }
.code-comment { color: #8B949E; }

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.step-content p {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin-bottom: 12px;
    line-height: 1.6;
}

/* ========== TEST WIDGET ========== */
.test-container {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.test-search {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.test-search input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
}

.test-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.test-results {
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-result-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.test-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.test-result-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--gray-100);
    flex-shrink: 0;
}

.test-result-info {
    flex: 1;
}

.test-result-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.test-result-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
}

.test-result-category {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    z-index: 1100;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

.toast-icon {
    font-size: 1.125rem;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.empty-text {
    color: var(--gray-500);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

/* ========== LOADING ========== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--gray-800);
}

.tab-btn.active {
    background: #fff;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

/* ========== PROJECT DETAIL ========== */
.back-btn {
    margin-bottom: 8px;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.back-btn:hover {
    color: var(--primary);
}

.btn-ghost {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--gray-500);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--danger-light);
}

.feed-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.feed-status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.feed-status-badge.loading {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.feed-status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.feed-url-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.feed-url-info {
    flex: 1;
    min-width: 200px;
}

.feed-url-display {
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    color: var(--gray-600);
    word-break: break-all;
}

.feed-url-actions {
    display: flex;
    gap: 8px;
}

.btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.feed-progress {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.feed-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

.feed-progress-text {
    color: var(--gray-600);
}

.feed-progress-percent {
    font-weight: 600;
    color: var(--primary);
}

.feed-progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.feed-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.feed-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius);
}

.feed-result-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.feed-result-stat {
    text-align: center;
}

.feed-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--success);
}

.feed-result-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.auto-update-info {
    margin-top: 20px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--info);
}

.auto-update-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--gray-600);
}

.auto-update-icon {
    font-size: 1.25rem;
}

.auto-update-time {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.auto-update-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.auto-update-badge.success {
    background: var(--success);
    color: #fff;
}

.auto-update-badge.error {
    background: var(--danger);
    color: #fff;
    cursor: help;
}

.api-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.api-key-code {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: var(--gray-800);
    color: #10B981;
    border-radius: var(--radius);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    letter-spacing: 1px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.quick-action-btn:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

.quick-action-icon {
    font-size: 1.25rem;
}

/* ========== PROJECT STATISTICS ========== */
.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.mini-stat {
    text-align: center;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.mini-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.mini-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.compact-list {
    max-height: 200px;
    overflow-y: auto;
}

.compact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.compact-list-item:last-child {
    border-bottom: none;
}

.compact-list-rank {
    width: 24px;
    height: 24px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-right: 12px;
}

.compact-list-rank.top {
    background: var(--primary);
    color: #fff;
}

.compact-list-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.compact-list-count {
    font-size: 0.75rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 10px;
}

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

.popular-product-card {
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    transition: all 0.2s ease;
}

.popular-product-card:hover {
    background: #fff;
    box-shadow: var(--shadow-md);
}

.popular-product-image {
    width: 100%;
    height: 100px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 8px;
}

.popular-product-name {
    font-size: 0.8125rem;
    color: var(--gray-800);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.popular-product-clicks {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.loading-sm {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .mini-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .popular-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== FEED GUIDE ========== */
.modal-lg {
    max-width: 800px;
}

.feed-guide {
    max-height: 70vh;
    overflow-y: auto;
}

.guide-intro {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.feed-guide h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 24px 0 12px;
}

.feed-guide h4:first-of-type {
    margin-top: 0;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.guide-table th,
.guide-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.guide-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.guide-table code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--primary);
}

.guide-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-tips li {
    position: relative;
    padding: 8px 0 8px 24px;
    color: var(--gray-600);
    font-size: 0.9375rem;
}

.guide-tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 600;
}

.cms-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.cms-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.cms-link:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

/* ========== FEED GUIDE SECTION (in Embed) ========== */
.feed-guide-section {
    max-height: none;
}

.guide-block {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--gray-200);
}

.guide-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.guide-block h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.guide-block h5 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 20px 0 12px;
}

.guide-block p {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 16px;
}

.guide-block code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--primary);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.tip-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-300);
}

.tip-card.tip-success {
    background: rgba(16, 185, 129, 0.05);
    border-left-color: var(--success);
}

.tip-card.tip-warning {
    background: rgba(245, 158, 11, 0.05);
    border-left-color: var(--warning);
}

.tip-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tip-content strong {
    display: block;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.tip-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

.cms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

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

.cms-card:hover {
    background: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.cms-logo {
    font-size: 2rem;
    margin-bottom: 12px;
}

.cms-name {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.cms-desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.cms-card .cms-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.cms-card .cms-link:hover {
    text-decoration: underline;
}

.guide-subtitle {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 24px 0 12px;
}

.guide-subtitle:first-of-type {
    margin-top: 0;
}

.guide-steps {
    margin: 0;
    padding-left: 24px;
}

.guide-steps li {
    padding: 8px 0;
    color: var(--gray-600);
    line-height: 1.6;
}

.guide-steps a {
    color: var(--primary);
    text-decoration: none;
}

.guide-steps a:hover {
    text-decoration: underline;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid-equal {
        grid-template-columns: 1fr;
    }
    
    .widget-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 20px 16px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .section-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .feed-url-form {
        flex-direction: column;
    }
    
    .feed-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-search input {
        width: 100%;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .donut-chart-container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .feed-stats {
        grid-template-columns: 1fr;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 10px;
        border-radius: var(--radius-lg);
    }
}

/* ========== OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.show {
    display: block;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
