@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
.rcc-wrap, .rcc-main-wrapper {
    --rcc-bg-main: #f1f5f9;
    --rcc-bg-card: #ffffff;
    --rcc-text-main: #0f172a;
    --rcc-text-muted: #64748b;
    --rcc-border-color: #cbd5e1;
    --rcc-border-light: #e2e8f0;
    --rcc-accent-color: #6366f1;
    --rcc-success: #10b981;
    --rcc-danger: #ef4444;
    
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--rcc-bg-main);
    padding: 25px;
    color: var(--rcc-text-main);
    min-height: 100vh;
    box-sizing: border-box;
}
.rcc-wrap *, .rcc-main-wrapper * { box-sizing: border-box; }

/* =========================================
   2. HEADER & BUTTONS
   ========================================= */
.rcc-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--rcc-bg-card); padding: 15px 20px;
    border-radius: 12px; border: 1px solid var(--rcc-border-light);
    margin-bottom: 25px; flex-wrap: wrap; gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.rcc-title { font-size: 20px; font-weight: 800; margin: 0; color: var(--rcc-text-main); letter-spacing: -0.5px; }
.rcc-header-right-actions { display: flex; gap: 10px; align-items: center; }
.rcc-header-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.rcc-btn {
    padding: 0 16px; height: 38px; border-radius: 8px; font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; color: white; display: inline-flex; align-items: center;
    justify-content: center; transition: all 0.2s; text-decoration: none; line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.rcc-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rcc-btn-add { background: #0f172a; }
.rcc-btn-sold { background: var(--rcc-success); }
.rcc-btn-delete { background: var(--rcc-danger); }
.rcc-btn-save { background: #10b981; }
.rcc-btn-export { background: #475569; }
.rcc-btn-view { background: #3b82f6; }

.rcc-btn-icon {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--rcc-border-light); background: white;
    cursor: pointer; font-size: 15px; text-decoration: none; color: #333; margin-left: 4px;
    transition: background 0.2s;
}
.rcc-btn-icon:hover { background: #f8fafc; border-color: #cbd5e1; }

/* =========================================
   3. KPI & FILTERS
   ========================================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 25px; }

.rcc-filter-area {
    background: var(--rcc-bg-card); padding: 20px; border-radius: 12px;
    border: 1px solid var(--rcc-border-light); margin-bottom: 20px;
    display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.rcc-filter-group { display: flex; flex-direction: column; flex: 1; min-width: 150px; }
.rcc-filter-group label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--rcc-text-muted); margin-bottom: 6px; }
.rcc-filter-group input, .rcc-filter-group select {
    width: 100%; height: 40px; border: 1px solid var(--rcc-border-color);
    border-radius: 8px; padding: 0 12px; background: #fff; font-size: 14px;
    color: var(--rcc-text-main);
}
.rcc-global-search-wrapper { display: flex; gap: 8px; }

.rcc-tabs-wrapper { display: flex; gap: 5px; margin-bottom: 20px; border-bottom: 2px solid var(--rcc-border-light); padding-bottom: 12px; overflow-x: auto; }
.rcc-tab { background: transparent; border: none; padding: 8px 16px; font-weight: 600; color: var(--rcc-text-muted); cursor: pointer; border-radius: 6px; text-decoration: none; display: inline-block; font-size: 14px; white-space: nowrap; }
.rcc-tab.active { background: #e2e8f0; color: var(--rcc-text-main); }
.rcc-tab:hover { background: #f1f5f9; color: var(--rcc-text-main); }

/* =========================================
   4. TABLE STYLES (Desktop)
   ========================================= */
.rcc-table-box { 
    background: var(--rcc-bg-card); 
    border-radius: 12px; 
    border: 1px solid var(--rcc-border-light); 
    overflow: hidden; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}

.rcc-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 13px; 
    table-layout: fixed; 
}

.rcc-table th, .rcc-table td { 
    padding: 12px 15px; 
    border-bottom: 1px solid var(--rcc-border-light); 
    vertical-align: middle;
    overflow: hidden; 
    text-overflow: ellipsis;
}

.rcc-table th { 
    background: #f8fafc; 
    text-align: left; 
    font-weight: 700; 
    color: var(--rcc-text-muted); 
    text-transform: uppercase; 
    font-size: 11px; 
    letter-spacing: 0.5px;
    height: 45px; 
}

/* --- COLUMN WIDTHS (Desktop) --- */
.rcc-col-check { width: 40px !important; text-align: center !important; padding: 0 !important; vertical-align: middle !important; }
.rcc-col-check input { margin: 0 auto !important; display: inline-block; width: 16px; height: 16px; cursor: pointer; }
.rcc-col-product { width: auto; } /* Auto fill */
.rcc-col-classification { width: 22%; }
.rcc-col-status { width: 15%; }
.rcc-col-finance { width: 15%; text-align: right; }
.rcc-col-actions { width: 110px; text-align: right; }

/* --- ROW STYLES --- */
tr.rcc-row-active { background-color: #ffffff; }
tr.rcc-row-active td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
tr.rcc-row-sold { background-color: #f0fdf4; }
tr.rcc-row-sold td:first-child { box-shadow: inset 3px 0 0 #10b981; }
tr.rcc-row-sold td { color: #166534; }
.rcc-table tr:hover td { background-color: #f8fafc; }

/* --- CELL CONTENT --- */
.rcc-item-flex { display: flex; gap: 12px; align-items: center; }
.rcc-item-img { 
    width: 40px !important; height: 40px !important; max-width: 40px !important;
    border-radius: 6px; object-fit: cover; border: 1px solid var(--rcc-border-light); 
    flex-shrink: 0; background: #fff; display: block;
}
.rcc-item-img.placeholder { background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.rcc-item-details { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.rcc-item-text { font-weight: 700; color: var(--rcc-text-main); font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.rcc-item-sku { 
    font-family: monospace; font-size: 10px; background: #f1f5f9; padding: 2px 6px; 
    border-radius: 4px; border: 1px solid #e2e8f0; color: var(--rcc-text-muted); 
    margin-bottom: 3px; display: inline-block; max-width: 140px; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}

.rcc-meta-row { font-size: 12px; color: var(--rcc-text-main); font-weight: 600; margin-bottom: 2px; }
.rcc-meta-row.sub { font-size: 11px; color: var(--rcc-text-muted); font-weight: 400; }

.rcc-status-pill { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; display: inline-block; margin-bottom: 4px; }
.rcc-pill-active { background: #eff6ff; color: #3b82f6; border: 1px solid #dbeafe; }
.rcc-pill-sold { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.rcc-sold-on-badge { font-size: 11px; font-weight: 700; color: #fff; background: #64748b; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-bottom: 2px; }
.rcc-sold-on-badge.ebay { background: #0064D2; }
.rcc-sold-on-badge.poshmark { background: #8b0a1d; }
.rcc-sold-on-badge.mercari { background: #6366f1; }
.rcc-sold-on-badge.depop { background: #ff0000; }

.rcc-plat-badges { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.rcc-mini-plat { width: 18px; height: 18px; border-radius: 50%; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: white; text-transform: uppercase; }
.rcc-mini-plat.ebay { background: #0064D2; }
.rcc-mini-plat.poshmark { background: #8b0a1d; }
.rcc-mini-plat.mercari { background: #6366f1; }
.rcc-mini-plat.depop { background: #ff0000; }
.rcc-no-plat { font-size: 10px; color: #ef4444; font-weight: 600; margin-top: 4px; background: #fef2f2; padding: 2px 6px; border-radius: 4px; display: inline-block; }

.rcc-stock-badge { font-size: 11px; font-weight: 700; color: #0369a1; }
.rcc-date-text { display: block; font-size: 10px; color: #94a3b8; margin-top: 2px; }

.rcc-fin-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.rcc-fin-row.net { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #e2e8f0; font-weight: 700; }
.rcc-fin-row .lbl { color: var(--rcc-text-muted); font-size: 10px; text-transform: uppercase; }
.rcc-fin-row .val { font-family: monospace; }
.val.pos { color: #10b981; } .val.neg { color: #ef4444; }

.rcc-action-group { display: flex; justify-content: flex-end; gap: 5px; }
.rcc-act-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; text-decoration: none; color: #64748b; transition: all 0.2s; }
.rcc-act-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; transform: translateY(-1px); }
.rcc-act-btn.view:hover { color: #3b82f6; background: #eff6ff; border-color: #dbeafe; }
.rcc-act-btn.edit:hover { color: #f59e0b; background: #fffbeb; border-color: #fcd34d; }

#rcc-bulkActionBar { display: none !important; position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #0f172a; padding: 12px 24px; border-radius: 50px; box-shadow: 0 15px 30px -5px rgba(0,0,0,0.4); z-index: 10000; align-items: center; gap: 20px; color: white; border: 1px solid #334155; }

/* =========================================
   5. DETAIL VIEW (Grid Layout)
   ========================================= */
.rcc-detail-top-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.rcc-detail-actions { display: flex; gap: 10px; }
.rcc-btn-back { background: #cbd5e1; color: #334155; } .rcc-btn-back:hover { background: #94a3b8; color: white; }

.rcc-detail-grid { display: grid; grid-template-columns: 350px 1fr; gap: 30px; align-items: start; }

.rcc-image-card { background: #fff; border-radius: 16px; border: 1px solid var(--rcc-border-light); padding: 15px; position: relative; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); text-align: center; }
.rcc-main-product-img { width: 100%; height: auto; max-height: 500px; object-fit: contain; border-radius: 8px; display: inline-block; background-color: #f8fafc; }
.rcc-no-image-placeholder { width: 100%; height: 300px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 24px; font-weight: 600; border-radius: 12px; }
.rcc-status-overlay { position: absolute; top: 20px; right: 20px; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.1); backdrop-filter: blur(4px); }
.status-active { background: rgba(255, 255, 255, 0.9); color: #3b82f6; border: 2px solid #3b82f6; } .status-sold { background: rgba(16, 185, 129, 0.9); color: white; border: 2px solid #059669; }

.rcc-qr-card { margin-top: 25px; padding: 0; overflow: hidden; border: 1px solid var(--rcc-border-light); border-radius: 12px; background: #f8fafc; }
.rcc-qr-flex { display: flex; align-items: stretch; }
.rcc-qr-left { background: #fff; padding: 20px; border-right: 2px dashed #cbd5e1; display: flex; align-items: center; justify-content: center; }
.rcc-qr-img { width: 90px; height: 90px; border-radius: 4px; border: 1px solid #e2e8f0; }
.rcc-qr-text { padding: 20px; display: flex; flex-direction: column; justify-content: center; flex: 1; }
.rcc-label-header { font-size: 10px; text-transform: uppercase; color: #94a3b8; font-weight: 800; letter-spacing: 1px; margin-bottom: 4px; }
.rcc-label-sku { font-family: monospace; font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1; margin-bottom: 8px; }
.rcc-label-loc { font-size: 12px; color: #0f172a; font-weight: 700; background: #e2e8f0; padding: 3px 8px; border-radius: 4px; display: inline-block; align-self: flex-start; }
.rcc-btn-text { background: none; border: none; padding: 0; color: #6366f1; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; margin-top: 10px; display: flex; align-items: center; gap: 5px; }
.rcc-btn-text:hover { color: #4f46e5; text-decoration: underline; }

.rcc-detail-header-block { margin-bottom: 25px; }
.rcc-detail-title { font-size: 28px; font-weight: 800; color: #0f172a; margin: 0 0 12px 0; line-height: 1.2; }
.rcc-detail-meta-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rcc-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; }
.rcc-pill-brand { background: #0f172a; color: white; } .rcc-pill-cat { background: #e2e8f0; color: #475569; } .rcc-pill-age { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }

.rcc-financial-hero { background: #fff; padding: 0; overflow: hidden; border: 1px solid #e2e8f0; }
.rcc-fin-header { background: #f8fafc; padding: 15px 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.rcc-fin-breakdown { display: flex; padding: 20px; gap: 10px; align-items: stretch; }
.rcc-fin-col { flex: 1; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid #e2e8f0; padding-right: 15px; }
.rcc-fin-col:last-child { border: none; padding-right: 0; }
.rcc-fin-col .lbl { font-size: 11px; text-transform: uppercase; color: #64748b; font-weight: 700; margin-bottom: 5px; }
.rcc-fin-col .val { font-size: 18px; font-weight: 700; font-family: monospace; }
.val.sales { color: #0f172a; } .val.cost { color: #ef4444; } .val.net.pos { color: #16a34a; } .val.net.neg { color: #ef4444; }

.rcc-platform-row { display: flex; gap: 10px; margin-bottom: 20px; }
.rcc-plat-btn { flex: 1; text-align: center; padding: 10px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 13px; color: white; transition: transform 0.2s; }
.rcc-plat-btn:hover { opacity: 0.9; transform: translateY(-2px); }
.rcc-plat-btn.ebay { background: #0064D2; } .rcc-plat-btn.posh { background: #8b0a1d; } .rcc-plat-btn.merc { background: #6366f1; }

.rcc-tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rcc-tool-btn { background: #fff; border: 1px solid #cbd5e1; color: #334155; padding: 10px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 12px; transition: all 0.2s; }
.rcc-tool-btn:hover { background: #f1f5f9; border-color: #94a3b8; } .rcc-tool-btn.full { grid-column: span 2; }

/* Specs Table */
.rcc-info-card { background: #fff; border: 1px solid var(--rcc-border-light); border-radius: 12px; padding: 25px; margin-bottom: 20px; }
.rcc-specs-table-wrapper { overflow-x: auto; border-radius: 8px; border: 1px solid var(--rcc-border-light); }
.rcc-specs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rcc-specs-table th, .rcc-specs-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--rcc-border-light); }
.rcc-specs-table th { width: 35%; background-color: #f8fafc; color: var(--rcc-text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.rcc-specs-table .mono { font-family: monospace; background: #f1f5f9; padding: 4px 8px; border-radius: 4px; color: #334155; font-weight: 700; display: inline-block; }

/* =========================================
   6. MODALS & FORMS
   ========================================= */
#rcc-addModal, #rcc-calcModal, #rcc-analyticsModal, #rcc-scannerModal, #rcc-searchResultModal, #rcc-customReportModal, #rcc-reportModal, #rcc-listingModal {
    display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px); overflow-y: auto; opacity: 1;
}
.rcc-modal-content { background: #ffffff; margin: 40px auto; padding: 0; border-radius: 16px; width: 90%; max-width: 750px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); border: 1px solid var(--rcc-border-light); position: relative; overflow: hidden; animation: rccSlideUp 0.3s ease-out; }
@keyframes rccSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.rcc-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 30px; background: #fff; border-bottom: 1px solid var(--rcc-border-light); position: sticky; top: 0; z-index: 50; }
.rcc-modal-header h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--rcc-text-main); letter-spacing: -0.5px; }
.rcc-close-btn { background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; color: #64748b; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.rcc-close-btn:hover { background: #fee2e2; color: #ef4444; }

#rcc-quickAddForm { padding: 30px; }
.rcc-form-section-title { font-size: 11px; font-weight: 800; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; margin-top: 25px; border-bottom: 1px solid #f1f5f9; padding-bottom: 5px; }
.rcc-form-section-title:first-child { margin-top: 0; }
.rcc-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 10px; }
.rcc-form-full { grid-column: span 2; }
.rcc-input-label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.rcc-modal-content input, .rcc-modal-content select, .rcc-modal-content textarea { width: 100%; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; height: 44px; color: #0f172a; transition: all 0.2s ease; }
.rcc-modal-content textarea { height: auto; padding: 12px; line-height: 1.5; resize: vertical; }
.rcc-modal-content input:focus, .rcc-modal-content select:focus, .rcc-modal-content textarea:focus { border-color: var(--rcc-accent-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); outline: none; }

.rcc-image-upload-wrapper { display: flex; gap: 20px; border: 2px dashed #cbd5e1; padding: 20px; border-radius: 12px; background: #f8fafc; margin-bottom: 25px; align-items: center; transition: border-color 0.2s; }
.rcc-image-upload-wrapper:hover { border-color: var(--rcc-accent-color); }
.rcc-image-preview-box { width: 120px; height: 120px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; flex-shrink: 0; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
#rcc-img_preview { width: 100%; height: 100%; object-fit: cover; }

.rcc-qty-box { grid-column: span 2; background: #eff6ff; padding: 20px; border-radius: 12px; border: 1px solid #dbeafe; display: flex; gap: 20px; align-items: center; margin-top: 10px; }
.rcc-qty-item { flex: 1; }
.rcc-qty-item label { color: #1e40af; font-size: 11px; font-weight: 700; }
.rcc-qty-item input { border-color: #93c5fd !important; background: #fff; font-weight: 700; color: #1e3a8a; text-align: center; font-size: 16px; }
.rcc-qty-result { text-align: center; padding: 0 15px; min-width: 80px; }
.rcc-qty-result label { color: #64748b; font-size: 10px; font-weight: 700; display: block; }
#rcc-qty-remaining-badge { font-size: 28px; font-weight: 800; color: #2563eb; line-height: 1; }

.rcc-toggle-header { background: #f8fafc; padding: 15px 20px; border-radius: 10px; cursor: pointer; font-weight: 600; color: #334155; font-size: 13px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; margin-top: 20px; transition: background 0.2s; }
.rcc-toggle-header:hover { background: #f1f5f9; border-color: #cbd5e1; }
#rcc-sales-data-section, #rcc-links-area { border: 1px solid #e2e8f0; border-top: none; margin-top: -5px; padding: 20px; background: #fff; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }

.rcc-modal-footer-actions { position: sticky; bottom: 0; background: white; padding: 15px 30px; border-top: 1px solid var(--rcc-border-light); display: flex; gap: 15px; z-index: 50; box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.02); }

/* =========================================
   7. REPORTS & ANALYTICS
   ========================================= */
.rcc-analytics-modal-wrapper { max-width: 1200px; width: 95%; padding: 0; display: flex; flex-direction: column; height: 90vh; background: #f1f5f9; border-radius: 12px; overflow: hidden; }
.rcc-analytics-header { padding: 20px 30px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; background: #fff; flex-shrink: 0; }
.rcc-analytics-body { padding: 30px; overflow-y: auto; flex: 1; }
.rcc-chart-card { background: #fff; padding: 25px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); margin-bottom: 25px; position: relative; }
.rcc-chart-card h3 { margin-top: 0; margin-bottom: 20px; font-size: 14px; color: #475569; }
.rcc-chart-row-refined { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 25px; margin-bottom: 10px; }
.chart-container-lg { height: 350px; position: relative; width: 100%; }
.chart-container-sm { height: 250px; position: relative; width: 100%; }

/* Report Paper (On Screen) */
.rcc-report-paper { background: white; width: 100%; max-width: 210mm; min-height: 297mm; margin: 40px auto; padding: 40px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2); position: relative; border-radius: 2px; }
.rcc-report-actions { position: absolute; top: -50px; right: 0; display: flex; gap: 10px; }
.rep-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 30px; }
.rep-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.rep-card { border: 1px solid #e2e8f0; padding: 20px 10px; border-radius: 8px; text-align: center; background: #f8fafc; }
.rep-label { font-size: 10px; text-transform: uppercase; color: #64748b; font-weight: 700; margin-bottom: 5px; letter-spacing: 0.5px; }
.rep-val { font-size: 22px; font-weight: 800; color: #1e293b; line-height: 1.1; }
.rep-chart-box { border: 1px solid #e2e8f0; padding: 15px; border-radius: 8px; height: 250px; position: relative; }
.rep-list-container { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.rep-list-item { padding: 10px 15px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; font-size: 13px; color: #334155; }
.rep-list-item:last-child { border-bottom: none; }
.rep-list-item span:last-child { font-weight: 600; font-family: monospace; }
.rep-goal-box { border: 1px solid #e2e8f0; padding: 25px; border-radius: 8px; text-align: center; }
.rep-progress-bg { width: 100%; background: #f1f5f9; height: 12px; border-radius: 6px; margin-top: 15px; overflow: hidden; }

/* =========================================
   8. PAGINATION STYLES
   ========================================= */
.rcc-pagination-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px; margin-top: 0; flex-wrap: wrap; gap: 15px; }
.rcc-pagination-info { font-size: 13px; color: var(--rcc-text-muted); font-weight: 600; }
.rcc-pagination-controls { display: flex; align-items: center; gap: 15px; }
.rcc-pagination-links { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 4px !important; }
.rcc-pagination-links .page-numbers { display: flex !important; align-items: center; justify-content: center; width: 32px !important; height: 32px !important; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--rcc-border-light); background: #fff; color: var(--rcc-text-main); line-height: 1; margin: 0 !important; padding: 0 !important; }
.rcc-pagination-links .page-numbers:hover { background: #f1f5f9; border-color: #cbd5e1; }
.rcc-pagination-links .page-numbers.current { background: var(--rcc-text-main); color: white; border-color: var(--rcc-text-main); }
.rcc-pagination-links .dots { border: none; background: transparent; width: auto !important; }
.rcc-per-page-select { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--rcc-text-muted); }
.rcc-per-page-select select { width: auto !important; height: 32px !important; padding: 0 8px !important; background-color: #fff; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; }

/* =========================================
   9. CALCULATOR STYLES
   ========================================= */
#rcc-calcModal .rcc-modal-content { max-width: 450px; background: #f8fafc; padding: 15px; }
.calc-input-group { margin-bottom: 15px; margin-top: 15px; background: white; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.calc-input-group label { font-size: 10px; color: #64748b; font-weight: 700; text-transform: uppercase; display: block; margin-bottom: 2px; }
.calc-input-group input { border: none; background: transparent; font-size: 24px; font-weight: 700; color: #0f172a; width: 100%; padding: 0; height: 34px; outline: none; box-shadow: none; }
.calc-input-group input:focus { border: none; box-shadow: none; }
.calc-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.calc-card { background: white; padding: 15px; border-radius: 10px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: transform 0.1s; }
.calc-card:hover { transform: scale(1.01); }
.calc-left { display: flex; flex-direction: column; gap: 4px; }
.calc-right { text-align: right; }
.calc-plat-badge { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 4px; display: inline-block; color: white; text-transform: uppercase; width: fit-content; }
.calc-plat-badge.ebay { background: #0064D2; } .calc-plat-badge.posh { background: #8b0a1d; } .calc-plat-badge.merc { background: #6366f1; } .calc-plat-badge.depop { background: #ff0000; }
.calc-detail { font-size: 11px; color: #94a3b8; font-weight: 500; }
.calc-profit { font-size: 20px; font-weight: 800; font-family: monospace; }
.calc-profit.pos { color: #10b981; } .calc-profit.neg { color: #ef4444; }
.calc-roi { font-size: 10px; font-weight: 700; color: #64748b; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-top: 2px; }

/* =========================================
   10. AI INSIGHTS
   ========================================= */
.rcc-ai-panel { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 25px; border: 1px solid #e2e8f0; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05); position: relative; overflow: hidden; }
.rcc-ai-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899); }
.rcc-ai-header { display: flex; align-items: center; margin-bottom: 15px; font-size: 14px; color: #0f172a; }
.rcc-ai-icon { font-size: 18px; margin-right: 8px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }
.rcc-ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.rcc-ai-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 8px; border: 1px solid transparent; }
.rcc-ai-card.success { background: #f0fdf4; border-color: #bbf7d0; } .rcc-ai-card.warning { background: #fff7ed; border-color: #ffedd5; } .rcc-ai-card.info { background: #eff6ff; border-color: #dbeafe; }
.ai-card-icon { font-size: 20px; line-height: 1; margin-top: 2px; }
.ai-card-title { font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 2px; color: #334155; }
.rcc-ai-card.success .ai-card-title { color: #15803d; } .rcc-ai-card.warning .ai-card-title { color: #c2410c; } .rcc-ai-card.info .ai-card-title { color: #1e40af; }
.ai-card-msg { font-size: 13px; color: #334155; line-height: 1.4; }
.ai-card-msg strong { font-weight: 700; color: #0f172a; }

/* =========================================
   11. LOADING OVERLAY & UTILS
   ========================================= */
#rcc-loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); z-index: 999999; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.rcc-loader-box { background: white; padding: 40px; border-radius: 16px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); min-width: 300px; }
.rcc-loader-box h3 { margin: 20px 0 10px 0; color: #0f172a; font-size: 18px; font-weight: 800; }
.rcc-loader-box p { color: #64748b; font-size: 13px; margin: 0; }
.rcc-spinner { width: 50px; height: 50px; border: 5px solid #e2e8f0; border-top: 5px solid #6366f1; border-radius: 50%; margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   12. MOBILE APP MODE (CARD LAYOUT)
   ========================================= */
@media (max-width: 768px) {
    /* Global */
    .rcc-wrap { padding: 10px; background: #f1f5f9; }
    
    /* Header */
    .rcc-header { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
    .rcc-header-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
    .hide-mobile { display: none !important; }

    /* CARD TRANSFORMATION */
    .rcc-table, .rcc-table tbody, .rcc-table tr, .rcc-table td { display: block; width: 100%; }
    .rcc-table thead { display: none; }
    
    .rcc-table tr {
        background: #fff; margin-bottom: 15px; border-radius: 12px; border: 1px solid #e2e8f0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03); padding: 15px; position: relative;
    }
    .rcc-table td { padding: 0; border: none; text-align: left; }

    /* Checkbox (Absolute Top Right) */
    .rcc-col-check { position: absolute; top: 15px; right: 15px; width: auto !important; z-index: 10; }
    .rcc-col-check input { width: 20px; height: 20px; }

    /* Product Section */
    .rcc-col-product { margin-bottom: 12px; padding-bottom: 12px !important; border-bottom: 1px solid #f1f5f9 !important; width: 100% !important; }
    .rcc-item-flex { align-items: flex-start; }
    .rcc-item-img { width: 70px !important; height: 70px !important; max-width: 70px !important; }
    .rcc-item-text { font-size: 15px; white-space: normal; max-height: 40px; overflow: hidden; margin-bottom: 4px; padding-right: 30px; }
    .rcc-item-sku { font-size: 11px; padding: 3px 6px; }

    /* Details Section */
    .rcc-col-classification { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; width: 100% !important; }
    
    /* Status Section */
    .rcc-col-status { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; width: 100% !important; }
    
    /* Financials Section */
    .rcc-col-finance { background: #f8fafc; padding: 10px !important; border-radius: 8px; margin-bottom: 15px; width: 100% !important; }
    .rcc-fin-row { display: flex; justify-content: space-between; width: 100%; font-size: 13px; margin-bottom: 2px; }
    .rcc-fin-row.net { margin-top: 5px; padding-top: 5px; border-top: 1px dashed #cbd5e1; font-size: 15px; }

    /* Actions Section */
    .rcc-col-actions { width: 100% !important; text-align: center !important; }
    .rcc-action-group { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
    .rcc-act-btn { width: 100%; height: 40px; border: 1px solid #e2e8f0; background: white; border-radius: 8px; font-size: 16px; }

    /* Modals & Grids Mobile */
    .rcc-modal-content { width: 95% !important; margin: 10px auto; padding: 20px; max-height: 85vh; }
    .rcc-form-grid { grid-template-columns: 1fr !important; gap: 15px; }
    .rcc-form-full { grid-column: span 1; }
    .rcc-qty-box { flex-direction: row; gap: 10px; }
    .rcc-detail-grid { grid-template-columns: 1fr; }
    .rcc-image-card { max-width: 100%; }
    .rcc-fin-breakdown { flex-direction: column; gap: 15px; }
    .rcc-fin-col { border: none; padding: 0; flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px; }
    .rcc-ai-grid { grid-template-columns: 1fr; }
    .rcc-chart-row-refined { grid-template-columns: 1fr; }
    .chart-container-lg, .chart-container-sm { height: 250px; }
}

/* =========================================
   13. PRINT STYLES (Final Corrected)
   ========================================= */
@media print {
    body, html { margin: 0 !important; padding: 0 !important; background: #fff !important; height: auto !important; overflow: visible !important; }
    body * { visibility: hidden; }

    /* Custom Report */
    #rcc-customReportModal { display: block !important; position: static !important; overflow: visible !important; visibility: hidden; }
    #rb_results_area { visibility: visible !important; display: block !important; position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: white !important; z-index: 9999; border: none !important; box-shadow: none !important; }
    #rb_results_area * { visibility: visible !important; color: black !important; }

    /* Snapshot Report */
    #rcc-reportModal { display: block !important; position: static !important; overflow: visible !important; visibility: hidden; }
    #rcc-reportModal .rcc-report-paper { visibility: visible !important; display: block !important; position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: white !important; z-index: 9999; box-shadow: none !important; }
    #rcc-reportModal .rcc-report-paper * { visibility: visible !important; color: black !important; }

    /* Hide UI */
    .rcc-modal-header, .rcc-filter-area, .no-print, .rcc-close-btn, button, .rcc-header, .rcc-tabs-wrapper { display: none !important; }

    /* Table Styles */
    .rcc-table { width: 100% !important; border-collapse: collapse !important; }
    .rcc-table th, .rcc-table td { border: 1px solid #000 !important; padding: 6px !important; font-size: 10pt !important; color: #000 !important; vertical-align: top !important; }
    .rcc-table th { background-color: #eee !important; font-weight: bold !important; -webkit-print-color-adjust: exact; }

    @page { margin: 1.5cm; size: auto; }
}