.cq-view { --cq-blue:#2563eb; --cq-soft:#eff6ff; --cq-muted:#64748b; max-width:1600px; margin:0 auto; padding:28px 22px 48px; color:var(--text); }
.cq-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.cq-eyebrow { font-size:12px; font-weight:600; color:var(--cq-muted); letter-spacing:.04em; margin-bottom:8px; }
.cq-view h1 { font-size:27px; letter-spacing:-.04em; margin-bottom:8px; }
.cq-heading p:not(.cq-eyebrow),.cq-upload p { color:var(--text-sub); font-size:13px; line-height:1.7; }
.cq-view h2,.cq-dialog h2 { font-size:16px; margin:0 0 10px; }
.cq-view button,.cq-dialog button { border:1px solid var(--border); background:var(--bg-card); color:var(--text); border-radius:8px; padding:9px 13px; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }
.cq-view button:hover,.cq-dialog button:hover { background:var(--bg-hover); }
.cq-view .cq-primary,.cq-dialog .cq-primary { background:var(--cq-blue,#2563eb); border-color:var(--cq-blue,#2563eb); color:#fff; }
.cq-view button:disabled,.cq-dialog button:disabled { opacity:.45; cursor:not-allowed; }
.cq-view .cq-danger { color:#dc2626; }
.cq-view input,.cq-view select,.cq-dialog input,.cq-dialog select { background:var(--bg-input); border:1px solid var(--border); color:var(--text); border-radius:7px; padding:8px 10px; font:inherit; font-size:12px; min-width:0; }
.cq-view input:focus,.cq-dialog input:focus,.cq-view select:focus { outline:2px solid #93c5fd; outline-offset:1px; }
.cq-view input[type=search] { flex:1; min-width:190px; max-width:380px; }
.cq-view input[type=checkbox] { accent-color:var(--cq-blue); width:15px; height:15px; }
.cq-view label,.cq-dialog label { display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--text-sub); }
.cq-panel { background:var(--bg-card); border:1px solid var(--border); border-radius:12px; padding:20px; margin-bottom:18px; box-shadow:0 2px 5px var(--shadow); }
.cq-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.cq-toolbar h2 { margin:0; }
.cq-toolbar .cq-check { flex-direction:row; align-items:center; }
.cq-notice { border-radius:8px; background:var(--cq-soft); color:#1d4ed8; padding:10px 14px; font-size:12px; margin-bottom:18px; line-height:1.6; }
.cq-notice.error { color:#b91c1c; background:#fef2f2; }
.cq-match-notice { padding:12px 14px; border:1px solid #fcd34d; background:#fffbeb; color:#92400e; border-radius:8px; font-size:12px; line-height:1.8; }
.cq-match-notice[hidden] { display:none; }
.cq-match-notice button { margin-left:10px; }
.cq-table-wrap { max-width:100%; overflow:auto; border:1px solid var(--border); border-radius:9px; }
.cq-table { border-collapse:separate; border-spacing:0; font-size:12px; width:100%; }
.cq-table th { padding:13px 12px; color:var(--text-sub); background:var(--bg-hover); font-weight:600; text-align:left; white-space:nowrap; border-bottom:1px solid var(--border-strong); }
.cq-table td { padding:12px; border-bottom:1px solid var(--border); vertical-align:middle; white-space:normal; }
.cq-table tbody tr:last-child td { border-bottom:0; }
.cq-table tbody tr:hover td { background:var(--bg-hover); }
.cq-table .cq-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cq-table .cq-name { min-width:170px; max-width:310px; overflow-wrap:anywhere; line-height:1.5; }
.cq-table .cq-id { white-space:nowrap; min-width:120px; }
.cq-table-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; }
.cq-table-footer button { padding:7px 10px; }
.cq-table-footer span { font-size:12px; padding:0 12px; }
.cq-badge { display:inline-block; border-radius:4px; background:#fef2f2; color:#b91c1c; padding:3px 6px; font-size:10px; margin-top:5px; }
.cq-sub { display:block; font-size:11px; color:var(--text-sub); margin-top:5px; }
.cq-empty { padding:38px 18px; text-align:center; color:var(--text-sub); font-size:13px; line-height:1.8; }
.cq-footnote { font-size:12px; line-height:1.7; color:var(--text-sub); margin-top:12px; }
.cq-upload { display:flex; flex-wrap:wrap; align-items:center; gap:22px; }
.cq-upload>div:first-child { flex:1; min-width:210px; }
.cq-file-label input { max-width:270px; }
.cq-preview { flex-basis:100%; border-top:1px solid var(--border); padding-top:16px; font-size:13px; line-height:1.8; }
.cq-preview[hidden] { display:none; }
.cq-preview .cq-toolbar { margin:12px 0 0; }
.cq-preview details { margin-top:10px; }
.cq-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:12px; margin:16px 0; }
.cq-kpi { background:var(--bg-input); border:1px solid var(--border); border-radius:9px; padding:16px; }
.cq-kpi span,.cq-kpi small { display:block; color:var(--text-sub); font-size:11px; line-height:1.6; }
.cq-kpi strong { display:block; margin:8px 0 4px; font-size:22px; letter-spacing:-.035em; font-variant-numeric:tabular-nums; }
.cq-kpi.cq-highlight { border-color:#bfdbfe; background:var(--cq-soft); }
.cq-sales-scroll { width:100%; overflow:auto; max-height:650px; border:1px solid var(--border); border-radius:9px; scrollbar-width:auto; }
.cq-sales-table { width:max-content; table-layout:fixed; }
.cq-sales-table th,.cq-sales-table td { width:96px; min-width:96px; text-align:right; }
.cq-sales-table th { position:sticky; top:0; z-index:2; }
.cq-sales-table th:nth-child(1),.cq-sales-table td:nth-child(1) { width:140px; min-width:140px; left:0; }
.cq-sales-table th:nth-child(2),.cq-sales-table td:nth-child(2) { width:210px; min-width:210px; max-width:210px; left:140px; }
.cq-sales-table th:nth-child(3),.cq-sales-table td:nth-child(3) { width:200px; min-width:200px; max-width:200px; left:350px; border-right:1px solid var(--border-strong); }
.cq-sales-table td:nth-child(-n+3) { position:sticky; z-index:1; background:var(--bg-card); text-align:left; white-space:normal; overflow-wrap:anywhere; }
.cq-sales-table th:nth-child(-n+3) { z-index:3; text-align:left; }
.cq-sales-table .cq-latest { background:var(--cq-soft); color:#1d4ed8; }
.cq-sales-table .cq-no-data { color:var(--text-muted); }
.cq-sales-table .cq-total td { background:var(--bg-hover); font-weight:700; }
.cq-sale-quantity { display:block; line-height:1.5; font-variant-numeric:tabular-nums; }
.cq-sale-revenue { display:block; margin-top:5px; color:var(--text-sub); font-size:10px; line-height:1.5; white-space:nowrap; font-variant-numeric:tabular-nums; }
.cq-total .cq-sale-revenue { font-weight:600; }
.cq-formula strong { font-size:12px; }
.cq-scroll-controls { display:flex; align-items:center; gap:14px; margin:14px 0; font-size:11px; color:var(--text-sub); }
.cq-scroll-controls input { flex:1; padding:0; accent-color:var(--cq-blue); cursor:ew-resize; }
.cq-periods { display:flex; gap:4px; border:1px solid var(--border); background:var(--bg-hover); border-radius:8px; padding:3px; }
.cq-periods button { border:0; background:transparent; }
.cq-periods .active { background:var(--cq-blue); color:#fff; }
.cq-chart { width:100%; height:230px; display:block; color:var(--cq-blue); }
.cq-chart-labels { display:flex; justify-content:space-between; font-size:11px; color:var(--text-sub); }
.cq-formula { border-top:1px solid var(--border); padding-top:15px; display:flex; gap:20px; align-items:center; flex-wrap:wrap; }
.cq-formula p { color:var(--text-sub); font-size:12px; line-height:1.7; }
.cq-panel summary { cursor:pointer; font-size:13px; font-weight:600; padding:3px 0; }
.cq-panel details>div,.cq-panel[open]>div { margin-top:14px; }
.cq-dialog { border:1px solid var(--border); border-radius:14px; background:var(--bg-card); color:var(--text); padding:24px; width:min(650px,calc(100vw - 32px)); max-height:90vh; overflow:auto; margin:auto; box-shadow:0 16px 80px #0003; }
.cq-dialog::backdrop { background:#0f172a66; }
.cq-dialog-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.cq-dialog-head h2 { margin:0; }
.cq-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.cq-dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:20px; }
.cq-error { font-size:12px; color:#b91c1c; line-height:1.6; margin-top:14px; }
.cq-menu-button,#cqMenuBackdrop { display:none; }
.cq-preview strong { overflow-wrap:anywhere; }
[data-theme=dark] .cq-view { --cq-soft:#18283f; --cq-muted:#94a3b8; }
[data-theme=dark] .cq-notice,[data-theme=dark] .cq-latest { color:#93c5fd; }
@media(max-width:900px) { .cq-view { padding:20px 12px; } .cq-heading { align-items:flex-start; } .cq-heading h1 { font-size:23px; } .cq-panel { padding:14px; } .cq-sales-table th:nth-child(2),.cq-sales-table td:nth-child(2),.cq-sales-table th:nth-child(3),.cq-sales-table td:nth-child(3) { position:static; } .cq-sales-table th:nth-child(2),.cq-sales-table th:nth-child(3) { position:sticky; left:auto; z-index:2; } }
@media(max-width:768px) {
    body.coupang-mode #appSidebar { display:none!important; }
    body.coupang-mode #mainContent.with-sidebar { margin-left:0!important; }
    body.coupang-mode.cq-menu-open #appSidebar { display:block!important; width:220px; z-index:1201; }
    body.coupang-mode.cq-menu-open #cqMenuBackdrop { display:block; position:fixed; inset:60px 0 0; border:0; background:#0f172a66; z-index:1200; padding:0; }
    .cq-menu-button { display:block; margin-bottom:12px; }
    .cq-heading { flex-wrap:wrap; }
    .cq-heading>div { width:100%; }
    .cq-file-label input { width:100%; max-width:100%; }
}
@media(max-width:520px) { .cq-heading { flex-wrap:wrap; } .cq-form-grid { grid-template-columns:1fr; } .cq-toolbar input[type=search] { max-width:none; width:100%; flex-basis:100%; } .cq-kpis { grid-template-columns:1fr 1fr; } .cq-kpi strong { font-size:19px; } .cq-upload { gap:14px; } .cq-upload>label { flex-basis:100%; } }
