/* --- RESET --- */
:root { --primary: #2563eb; --bg: #f8fafc; --text: #1e293b; --card: #ffffff; }
#cpg-ui-container { display: flex; background: var(--bg); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; color: var(--text); overflow: hidden; position: relative; max-width: 100%; border: none; user-select: none; -webkit-user-select: none; }

/* --- SIDEBAR --- */
.cpg-sidebar { width: 240px; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; padding: 20px 0; z-index: 100; }
.cpg-nav-item { padding: 12px 24px; cursor: pointer; color: #64748b; font-weight: 600; display: flex; align-items: center; gap: 12px; transition: 0.2s; }
.cpg-nav-item:hover, .cpg-nav-item.active { color: var(--primary); background: #eff6ff; }
.cpg-nav-item i { font-size: 18px; width: 24px; text-align: center; }

/* --- MAIN --- */
.cpg-main { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding-bottom: 100px; }
.cpg-section-title { font-size: 13px; font-weight: 800; color: #94a3b8; letter-spacing: 0.5px; margin-bottom: 12px; width: 100%; max-width: 500px; }

/* --- CARDS & INPUTS --- */
.cpg-profile-card, .cpg-upload-box { background: var(--card); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); padding: 20px; width: 100%; max-width: 500px; margin-bottom: 16px; border: 1px solid #f1f5f9; }
.cpg-input-nice, .cpg-modal input { width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; font-size: 15px; outline: none; transition: 0.2s; margin-bottom: 10px; }
.cpg-input-nice:focus { border-color: var(--primary); background: #fff; }
.cpg-upload-box { border: 2px dashed #cbd5e1; text-align: center; cursor: pointer; color: var(--primary); }

/* --- HISTORY (PRO UI) --- */
.cpg-history-list { width: 100%; max-width: 500px; }
.cpg-history-card { background: #fff; padding: 15px; border-radius: 12px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.03); border: 1px solid #f1f5f9; transition: 0.2s; }
.cpg-history-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.cpg-hist-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 16px; margin-right: 15px; }
.cpg-credit { color: #10b981; background: #d1fae5; }
.cpg-debit { color: #ef4444; background: #fee2e2; }
.cpg-hist-info { flex: 1; }
.cpg-hist-info h4 { margin: 0 0 4px 0; font-size: 15px; color: #334155; font-weight: 700; }
.cpg-hist-info span { font-size: 12px; color: #94a3b8; }
.cpg-hist-amount { text-align: right; }
.cpg-hist-amount span { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.cpg-status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; text-transform: uppercase; font-weight: 700; }
.cpg-status-success { background: #dcfce7; color: #15803d; }
.cpg-status-failed { background: #fce7f3; color: #be185d; }

/* --- RIGHT PANEL --- */
.cpg-right-panel { width: 300px; background: #fff; border-left: 1px solid #e2e8f0; padding: 20px; display: flex; flex-direction: column; }
.cpg-branding-card { display: flex; align-items: center; gap: 15px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; margin-bottom: 10px; cursor: pointer; }
.cpg-branding-card.active { background: #eff6ff; border-color: var(--primary); color: var(--primary); font-weight: 600; }
.cpg-branding-card.active::after { content: '\f00c'; font-family: 'Font Awesome 5 Free'; font-weight: 900; margin-left: auto; }
.cpg-icon-box { width: 36px; height: 36px; background: #e2e8f0; border-radius: 8px; display: flex; justify-content: center; align-items: center; font-weight: bold; color: #64748b; }

/* --- BUTTONS & EXTRAS --- */
.cpg-action-btn-main { width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 12px; font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); margin-top: auto; }
.cpg-btn-small { background: #10b981; color: white; border: none; padding: 0 16px; border-radius: 8px; cursor: pointer; }
.cpg-template-scroll { display: flex; gap: 12px; overflow-x: auto; width: 100%; max-width: 500px; padding: 5px; scrollbar-width: none; }
.cpg-scroll-item { min-width: 90px; height: 120px; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 2px solid transparent; transition: 0.2s; }
.cpg-scroll-item.selected { border-color: var(--primary); transform: scale(0.98); }
.cpg-scroll-item img { width: 100%; height: 100%; object-fit: cover; }
.cpg-canvas-wrapper { background: #fff; padding: 10px; border-radius: 16px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); margin-top: 20px; }
.cpg-pass-wrapper { position: relative; width: 100%; }
.cpg-pass-wrapper input { width: 100%; padding-right: 40px; }
.cpg-toggle-pass { position: absolute; right: 10px; top: 35%; transform: translateY(-50%); cursor: pointer; color: #64748b; }

/* --- MODAL --- */
.cpg-modal { display: none; position: fixed; z-index: 9999; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); justify-content: center; align-items: center; }
.cpg-modal-content { background: white; padding: 25px; border-radius: 20px; width: 90%; max-width: 380px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.2); position: relative; }
.cpg-close-modal { position: absolute; right: 20px; top: 15px; font-size: 24px; cursor: pointer; color: #94a3b8; }

/* --- MOBILE --- */
@media (max-width: 900px) {
    #cpg-ui-container { flex-direction: column; padding-bottom: 70px; }
    .cpg-sidebar { position: fixed; bottom: 0; left: 0; width: 100%; height: 70px; flex-direction: row; justify-content: space-around; padding: 0; border-top: 1px solid #e2e8f0; border-right: none; box-shadow: 0 -5px 20px rgba(0,0,0,0.05); }
    .cpg-nav-item { flex-direction: column; gap: 4px; font-size: 11px; padding: 10px; flex: 1; justify-content: center; }
    .cpg-nav-item i { font-size: 20px; }
    .cpg-main { padding: 15px; width: 100%; }
    .cpg-right-panel { width: 100%; padding: 15px; border-left: none; border-top: 1px solid #e2e8f0; background: #fff; }
}