/* KASPEROPAY MERCHANT DASHBOARD - Desktop Only */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #0f172a;
    background: #f8fafc;
}

/* ========== LAYOUT ========== */

.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    z-index: 100;
    flex-shrink: 0;
	overflow: hidden;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    height: 80px;
    min-height: 80px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-body {
    flex: 1;
    padding: 48px;
    width: 100%;
}

.mobile-menu-btn { display: none; }

/* ========== SIDEBAR ========== */

.sidebar-header {
    padding: 32px;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-logo img { width: 36px; height: 36px; }

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
    overflow-y: auto;
}

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

.nav-section-title {
    padding: 12px 32px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 16px;
    padding: 14px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 10px;
}

.nav-link:hover { background: #1e293b; color: #fff; }
.nav-link.active { background: #4f46e5; color: #fff; }
.nav-link i { width: 20px; text-align: center; }

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #334155;
}

.store-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: #1e293b;
    border-radius: 10px;
    margin-bottom: 16px;
}

.store-avatar {
    width: 44px;
    height: 44px;
    background: #4f46e5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.store-details { flex: 1; min-width: 0; }
.store-name { font-weight: 600; font-size: 14px; color: #fff; }
.store-id { font-size: 12px; color: #64748b; font-family: 'JetBrains Mono', monospace; }

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 0;
}
.logout-link:hover { color: #fff; }

/* ========== PAGE TITLE ========== */

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
}

.header-actions { display: flex; gap: 12px; }

.header-actions .sidebar-user {
    background: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* ========== STATS SUMMARY ========== */

.stats-summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 56px;
    margin-bottom: 48px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.stats-summary-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.stat-item { display: flex; flex-direction: column; gap: 4px; }

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-value small {
    font-size: 1rem;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 4px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.stat-divider {
    width: 1px;
    height: 64px;
    background: #e2e8f0;
}

/* ========== OVERVIEW GRID ========== */

.overview-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    width: 100%;
}

.overview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 400px;
}

/* ========== CARDS ========== */

.card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    width: 100%;
}

.card-header {
    padding: 28px 32px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body { padding: 32px; }

/* ========== PAYMENTS TABLE ========== */

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

.payments-table th,
.payments-table td {
    padding: 18px 20px;
    text-align: left;
}

.payments-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.payments-table td {
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.payments-table tbody tr:hover { background: #f8fafc; }

.text-muted { color: #94a3b8; font-size: 13px; }

.tx-link {
    color: #4f46e5;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.status-badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-completed { background: #d1fae5; color: #059669; }
.status-pending { background: #fef3c7; color: #d97706; }
.status-failed { background: #fee2e2; color: #dc2626; }

/* ========== WALLET DISTRIBUTION ========== */

.wallet-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
}

.wallet-bar + .wallet-bar { border-top: 1px solid #f1f5f9; }
.wallet-bar-label { width: 100px; font-size: 14px; font-weight: 500; }
.wallet-bar-track { flex: 1; height: 10px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.wallet-bar-fill { height: 100%; border-radius: 5px; }
.wallet-bar-value { width: 50px; text-align: right; font-size: 14px; font-weight: 600; color: #475569; }

/* ========== ACTIVITY FEED ========== */

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
}

.activity-item + .activity-item { border-top: 1px solid #f1f5f9; }

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-icon.payment { background: #d1fae5; color: #059669; }
.activity-content { flex: 1; }
.activity-text { font-size: 14px; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 13px; color: #94a3b8; margin-top: 4px; }

/* ========== FEES ========== */

.fees-summary {
    display: flex;
    gap: 48px;
    padding: 40px 48px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 32px;
    width: 100%;
}

.fee-stat { display: flex; flex-direction: column; gap: 4px; }
.fee-stat-label { font-size: 14px; font-weight: 500; color: #475569; }
.fee-stat-value { font-size: 1.75rem; font-weight: 700; }

.fee-options {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.fee-option {
    flex: 1;
    max-width: 200px;
    padding: 24px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
}

.fee-option:hover { border-color: #6366f1; }
.fee-option:has(input:checked) { border-color: #4f46e5; background: #eef2ff; }
.fee-option input { display: none; }
.fee-option strong { font-size: 1.5rem; }

/* ========== WIDGET BUILDER ========== */

.widget-type-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.widget-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 36px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.widget-type-card:hover { border-color: #6366f1; }
.widget-type-card.active { border-color: #4f46e5; background: #eef2ff; }
.widget-type-card i { font-size: 1.5rem; color: #4f46e5; }

.widget-builder-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 40px;
    width: 100%;
}

.card-body h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 16px;
    margin-top: 28px;
}

.card-body h4:first-child { margin-top: 0; }

.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label, .radio-group label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.checkbox-group label:hover, .radio-group label:hover {
    border-color: #6366f1;
    background: #eef2ff;
}

.checkbox-group input, .radio-group input {
    width: 18px;
    height: 18px;
    accent-color: #4f46e5;
}

/* ========== CODE BLOCKS ========== */

.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 28px 32px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre;
    min-height: 400px;
    width: 100%;
}

.code-wrapper { position: relative; }

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.1);
    color: #cdd6f4;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* ========== FORMS ========== */

.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #0f172a;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}

.wallet-provider-fields .form-group input[type="password"],
.wallet-provider-fields .form-group input[type="email"] {
    	max-width: 320px;
}

.wallet-provider-fields .btn {
    max-width: 320px;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px #eef2ff;
}

.form-group small {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
}

.readonly-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #64748b;
}

.btn-icon:hover { color: #4f46e5; }

/* ========== EMBED PREVIEW ========== */

.embed-preview {
    margin-top: 40px;
    padding: 48px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 16px;
    text-align: center;
}

.preview-pay-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.preview-info {
    margin-top: 20px;
    font-size: 14px;
    color: #64748b;
}

/* ========== BUTTONS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }

.btn-secondary {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover { background: #e2e8f0; }
.btn-sm { padding: 10px 18px; font-size: 13px; }

/* ========== EMPTY STATE ========== */

.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: #94a3b8;
}

.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 15px; }
.empty-state.small { padding: 40px 24px; }
.empty-state.small i { font-size: 2rem; }

/* ========== SECTIONS ========== */

.dashboard-section { display: none; width: 100%; }
.dashboard-section.active { display: block; }

/* ========== LOGIN PAGE ========== */

.login-page {
    position: fixed;
    inset: 0;
    background: #f1f5f9;
    z-index: 1000;
}

.login-page.hidden { display: none !important; }

.login-split {
    display: flex;
    height: 100vh;
    width: 100%;
}

.login-hero {
    flex: 1;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: #fff;
}

.login-hero-content { max-width: 520px; }

.login-hero-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.login-hero > p,
.login-hero-content > p {
    font-size: 17px;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 48px;
}

.login-features { display: flex; flex-direction: column; gap: 24px; }

.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.login-feature i {
    width: 44px;
    height: 44px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.login-feature div { display: flex; flex-direction: column; gap: 4px; }
.login-feature strong { font-size: 15px; font-weight: 600; color: #fff; }
.login-feature span { font-size: 14px; color: #94a3b8; }

.login-form-side {
    width: 520px;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.login-container { text-align: center; width: 100%; max-width: 380px; }

.login-header { margin-bottom: 40px; }
.login-logo { width: 64px; height: 64px; margin-bottom: 16px; }
.login-header h1 { font-size: 1.75rem; font-weight: 700; color: #1e3a5f; margin-bottom: 6px; }
.login-header p { font-size: 15px; color: #64748b; }

.login-box {
    background: #fff;
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.login-box h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
.login-box > p { color: #64748b; margin-bottom: 28px; font-size: 14px; }

/* Inline wallet options on login */
.login-wallet-list { display: flex; flex-direction: column; gap: 10px; }

.login-wallet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    text-align: left;
}

.login-wallet-option:hover { border-color: #6366f1; background: #f8f7ff; }
.login-wallet-option.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.login-wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f1f5f9;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
}

.login-wallet-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.login-wallet-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.login-wallet-info strong { font-size: 14px; font-weight: 600; color: #0f172a; }
.login-wallet-info span { font-size: 12px; color: #64748b; }

.login-wallet-arrow { font-size: 18px; color: #94a3b8; flex-shrink: 0; }

.login-wallet-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 12px;
    margin: 4px 0;
}

.login-wallet-divider::before,
.login-wallet-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.login-footer {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #94a3b8;
}

.login-email-link {
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}

.login-email-link:hover { text-decoration: underline; }

/* Email auth modal */
.email-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-auth-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.12);
    overflow: hidden;
}

.email-auth-header {
    padding: 24px 28px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-auth-header h2 { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.email-auth-header button { background: none; border: none; font-size: 24px; cursor: pointer; color: #94a3b8; padding: 0; line-height: 1; }

.email-auth-body { padding: 24px 28px 28px; }

.email-auth-body .form-group { margin-bottom: 16px; }
.email-auth-body label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.email-auth-body input[type="email"],
.email-auth-body input[type="password"],
.email-auth-body input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.email-auth-body input:focus { border-color: #6366f1; outline: none; }

.email-auth-error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.email-auth-success {
    color: #22c55e;
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.email-auth-submit {
    width: 100%;
    padding: 12px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.email-auth-submit:hover { background: #4f46e5; }
.email-auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.email-auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #64748b;
}

.email-auth-toggle a { color: #6366f1; font-weight: 600; text-decoration: none; }
.email-auth-toggle a:hover { text-decoration: underline; }

.email-auth-forgot {
    text-align: center;
    margin-top: 8px;
    font-size: 13px;
}

.email-auth-forgot a { color: #94a3b8; text-decoration: none; }
.email-auth-forgot a:hover { color: #6366f1; }

/* ========== NOTIFICATIONS ========== */

.notification {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-left: 4px solid #4f46e5;
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
}

.notification.show { transform: translateY(0); opacity: 1; }
.notification.success { border-left-color: #059669; }
.notification.error { border-left-color: #dc2626; }
.notification.info { border-left-color: #4f46e5; }
.notification i { font-size: 1.25rem; }
.notification.success i { color: #059669; }
.notification.error i { color: #dc2626; }
.notification.info i { color: #4f46e5; }
.notification span { font-size: 14px; font-weight: 500; }

/* ========== EMBED PAGE ========== */

.embed-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.section-description {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.embed-preview-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f8fafc;
    border-radius: 8px;
}

.merchant-id-display {
    display: flex;
    align-items: center;
    gap: 16px;
}

.merchant-id-display code {
    background: #1e293b;
    color: #49eacb;
    padding: 10px 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

/* ========== FEES PAGE ========== */

.fees-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
    margin-top: 24px;
}

.fees-left-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fee-explainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fee-explainer-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.fee-explainer-item i {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    color: #4f46e5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fee-explainer-item strong {
    display: block;
    margin-bottom: 4px;
    color: #0f172a;
}

.fee-explainer-item p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.fee-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.fee-breakdown-item .fee-tx {
    font-size: 13px;
    color: #64748b;
}

.fee-breakdown-item .fee-amount {
    font-weight: 600;
    color: #0f172a;
}

/* ========== FEE INVOICE STYLE ========== */

.fee-invoice {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 8px;
}

.fee-invoice-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #cbd5e1;
}

.fee-invoice-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.fee-invoice-line .fee-week {
    color: #64748b;
}

.fee-invoice-line .fee-week-amount {
    font-weight: 500;
    color: #0f172a;
}

.fee-invoice-line .fee-week-amount.zero {
    color: #94a3b8;
}

.fee-invoice-line .fee-week-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 0 12px;
    overflow: hidden;
}

.fee-invoice-line .fee-week-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.fee-invoice-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.fee-invoice-total span {
    color: #64748b;
}

.fee-invoice-total strong {
    font-size: 18px;
    color: #0f172a;
}

/* ========== WIDGET PREVIEW TABS ========== */

.preview-tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.preview-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.preview-tab:hover {
    color: #0f172a;
}

.preview-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.preview-tab i {
    font-size: 12px;
}

.widget-tab-content {
    display: none;
}

.widget-tab-content.active {
    display: block;
}

.widget-visual-preview {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 40px;
}

/* ========== LIVE WIDGET MODAL PREVIEW ========== */

.widget-preview-frame {
    width: 100%;
    min-height: 450px;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.widget-preview-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

/* Mock Modal Container */
.kp-preview-modal {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    z-index: 1;
}

/* Modal Header - Default/Institutional (navy header) */
.kp-preview-header {
    padding: 20px 24px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a365d;
}

.kp-preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.kp-preview-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Body */
.kp-preview-body {
    padding: 24px;
    background: white;
}

.kp-preview-subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin: 0 0 20px;
}

/* Wallet Options */
.kp-preview-wallet {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    background: white;
}

.kp-preview-wallet:hover {
    border-color: #667eea;
    background: #f8f9ff;
}



/* Wallet icon */
.kp-preview-wallet-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    background: #f1f5f9;
}

.kp-preview-wallet-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.kp-preview-wallet-icon.qrcode {
    background: #1a365d;
}

.kp-preview-wallet-icon.qrcode svg {
    width: 22px;
    height: 22px;
    color: white;
}

.kp-preview-wallet-info {
    flex: 1;
}

.kp-preview-wallet-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

.kp-preview-wallet-info span {
    font-size: 12px;
    color: #666;
}

.kp-preview-arrow {
    color: #667eea;
    font-size: 16px;
}

/* ===== THEME: DARK ===== */
.kp-preview-modal.theme-dark {
    background: #0f172a;
    border: 1px solid #334155;
}

.kp-preview-modal.theme-dark .kp-preview-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

.kp-preview-modal.theme-dark .kp-preview-header h3 {
    color: #f1f5f9;
}

.kp-preview-modal.theme-dark .kp-preview-close {
    background: #334155;
    color: #94a3b8;
}

.kp-preview-modal.theme-dark .kp-preview-body {
    background: #0f172a;
}

.kp-preview-modal.theme-dark .kp-preview-subtitle {
    color: #94a3b8;
}

.kp-preview-modal.theme-dark .kp-preview-wallet {
    background: #1e293b;
    border-color: #334155;
}

.kp-preview-modal.theme-dark .kp-preview-wallet:hover {
    border-color: #49eacb;
}

.kp-preview-modal.theme-dark .kp-preview-wallet-icon {
    background: #334155;
}

.kp-preview-modal.theme-dark .kp-preview-wallet-info strong {
    color: #f1f5f9;
}

.kp-preview-modal.theme-dark .kp-preview-wallet-info span {
    color: #94a3b8;
}

.kp-preview-modal.theme-dark .kp-preview-arrow {
    color: #49eacb;
}

/* ===== THEME: SOFT ===== */
.kp-preview-modal.theme-soft .kp-preview-header {
    background: #edf2f7;
}

.kp-preview-modal.theme-soft .kp-preview-header h3 {
    color: #1a365d;
}

.kp-preview-modal.theme-soft .kp-preview-close {
    background: #cbd5e0;
    color: #4a5568;
}

.kp-preview-modal.theme-soft .kp-preview-wallet-icon {
    background: #e2e8f0;
}

/* ===== THEME: PILL ===== */
.kp-preview-modal.theme-pill .kp-preview-header {
    background: #1a365d;
}

.kp-preview-modal.theme-pill .kp-preview-header h3 {
    color: white;
}

.kp-preview-modal.theme-pill .kp-preview-close {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* ===== THEME: GHOST ===== */
.kp-preview-modal.theme-ghost .kp-preview-header {
    background: white;
    border-bottom: 2px solid #1a365d;
}

.kp-preview-modal.theme-ghost .kp-preview-header h3 {
    color: #1a365d;
}

.kp-preview-modal.theme-ghost .kp-preview-close {
    background: #f1f5f9;
    color: #64748b;
}

/* Preview Badge */
.widget-preview-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Preview Theme Indicator */
.widget-preview-theme-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
}

/* Dark preview frame background */
.widget-preview-frame.dark-bg {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
}

.widget-preview-frame.dark-bg::before {
    background: 
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
}

.widget-preview-frame.dark-bg .widget-preview-badge {
    background: rgba(255,255,255,0.2);
}

.widget-preview-frame.dark-bg .widget-preview-theme-tag {
    background: #334155;
    color: #94a3b8;
}

/* Wallet option with description */
.wallet-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-option-content strong {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.wallet-option-content small {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.checkbox-group label:hover .wallet-option-content small {
    color: #4f46e5;
}

.header-store-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a365d;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-left: 12px;
}

/* =============================================
   PROFILE DROPDOWN
============================================= */

.header-profile {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.profile-trigger:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #49eacb 0%, #40c9a2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-name {
    font-weight: 500;
    color: #1e293b;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trigger i {
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.profile-trigger.open i {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.profile-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #49eacb 0%, #40c9a2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.profile-info {
    min-width: 0;
}

.profile-store-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-merchant-id {
    font-size: 12px;
    color: #64748b;
    font-family: monospace;
}

.profile-dropdown-menu {
    padding: 8px;
}

.profile-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.profile-dropdown-menu a:hover {
    background: #f8fafc;
    color: #1e293b;
}

.profile-dropdown-menu a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: #94a3b8;
}

.profile-dropdown-menu a:hover i {
    color: #49eacb;
}

.profile-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 0;
}

.profile-dropdown-menu .logout-item {
    color: #ef4444;
}

.profile-dropdown-menu .logout-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.profile-dropdown-menu .logout-item i {
    color: #f87171;
}

/* Hide old store name display if present */
.header-store-name {
    display: none;
}

/* =============================================
   MODAL
============================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-container {
    transform: scale(1) translateY(0);
}

.modal-md {
    width: 600px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* =============================================
   AVATAR UPLOAD
============================================= */

.avatar-upload-area {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 24px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, #49eacb 0%, #40c9a2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.avatar-preview span {
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.avatar-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-upload-controls .btn {
    width: fit-content;
}

.avatar-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* =============================================
   PROFILE FORM
============================================= */

.profile-edit-section {
    margin-bottom: 0;
}

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

.form-row input[type="text"],
.form-row input[type="email"],
.form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.form-row input[type="text"]:focus,
.form-row input[type="email"]:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #49eacb;
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.form-row small {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

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

.form-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 24px 0;
}

.readonly-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #475569;
}

.readonly-field code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: #64748b;
}

.readonly-field .btn-icon {
    margin-left: auto;
}

/* Button variants */
.btn-ghost {
    background: transparent;
    border: none;
    color: #64748b;
}

.btn-ghost:hover {
    background: #f1f5f9;
    color: #475569;
}

#profileModal .modal-body {
    padding: 24px;
}

#profileModal .form-row,
#profileModal .form-group {
    width: 100%;
    display: block;
}

#profileModal input[type="text"],
#profileModal input[type="email"],
#profileModal textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

#profileModal .avatar-upload-area {
    width: 100%;
    margin-bottom: 24px;
}

/* =============================================
   CHAT WIDGET (Fixed position, no floating button)
============================================= */

.chat-widget-fixed {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.chat-box {
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    background: #1e293b;
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
}

.chat-close:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 15px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.support {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
}

.chat-message.user .chat-bubble {
    background: #49eacb;
    color: #1e293b;
}

.chat-message.support .chat-bubble {
    background: white;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.chat-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

#chatInput:focus {
    border-color: #49eacb;
}

.chat-send-btn {
    padding: 10px 20px;
    background: #49eacb;
    color: #1e293b;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
}

.chat-send-btn:hover {
    background: #40c9a2;
}

.chat-loading {
    text-align: center;
    padding: 20px;
    color: #718096;
}

.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.chat-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.nav-submenu {
    display: none;
    padding-left: 32px;
}
.nav-submenu.open {
    display: block;
}
.submenu-arrow {
    margin-left: auto;
    transition: transform 0.2s;
}
.has-submenu.open .submenu-arrow {
    transform: rotate(180deg);
}

.nav-submenu a {
    display: block;
    padding: 8px 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-submenu a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* =============================================
   STORE SECTION
============================================= */
.store-header-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.store-enable-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.store-url-display {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.store-url-display a {
    color: var(--primary-color);
    font-family: monospace;
}

.store-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .store-grid {
        grid-template-columns: 1fr;
    }
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: #6366f1;
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label-text {
    font-size: 14px;
    color: #334155;
}

/* Store URL slug prefix */
.input-with-slug-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.input-with-slug-prefix .input-prefix {
    position: static;
    transform: none;
    padding: 14px 0 14px 18px;
    background: transparent;
    color: #94a3b8;
    font-size: 15px;
    white-space: nowrap;
    pointer-events: auto;
}
.input-with-slug-prefix input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    flex: 1;
    background: transparent !important;
}
.input-with-slug-prefix:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px #eef2ff;
}

/* Banner Upload */
.banner-upload-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.banner-preview {
    width: 100%;
    height: 120px;
    background: var(--bg-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}

.banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-controls {
    display: flex;
    gap: 8px;
}

/* Products Grid */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.product-image {
    width: 60px;
    height: 60px;
    background: var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.product-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.product-price {
    color: var(--text-muted);
    font-size: 14px;
}

.product-status {
    font-size: 12px;
    text-transform: uppercase;
}

.product-status.status-active {
    color: var(--success-color, #10b981);
}

.product-status.status-inactive {
    color: var(--text-muted);
}

.product-actions {
    display: flex;
    gap: 4px;
}

/* Domain Whitelist */
#domainList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    align-items: center;
}

#domainList:empty::after {
    content: 'No domains configured – payments allowed from any domain';
    color: #94a3b8;
    font-size: 14px;
}

.domain-tag {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
}

.domain-tag button {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.domain-tag button:hover {
    color: #ef4444;
}

.domain-add-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.domain-add-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.domain-add-row input:focus {
    outline: none;
    border-color: #49eacb;
}

.domain-add-row .btn {
    white-space: nowrap;
}

.label-optional {
    font-weight: 400;
    color: #64748b;
    font-size: 13px;
}

/* =============================================
   INVOICES
============================================= */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
}

.invoice-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-stats .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.invoice-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.invoice-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-left: 0.35rem;
}

/* Invoice Modal */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.invoice-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 40px;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.invoice-item-row input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.invoice-item-row .btn-remove-item {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.invoice-item-row .btn-remove-item:hover {
    color: var(--danger-color);
}

.invoice-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .invoice-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .invoice-item-row {
        grid-template-columns: 1fr 60px 80px 32px;
    }
}

/* =============================================
   INVOICE MODAL STYLING
============================================= */

#invoiceModal .modal-body {
    padding: 1.5rem;
}

#invoiceModal .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

#invoiceModal .form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#invoiceModal .form-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 1rem;
}

#invoiceModal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

#invoiceModal .form-group {
    margin-bottom: 1rem;
}

#invoiceModal .form-group:last-child {
    margin-bottom: 0;
}

#invoiceModal .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

#invoiceModal .form-group input,
#invoiceModal .form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#invoiceModal .form-group input:focus,
#invoiceModal .form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#invoiceModal .form-group input::placeholder,
#invoiceModal .form-group textarea::placeholder {
    color: #9ca3af;
}

/* Line Items */
#invoiceModal .invoice-item-row {
    display: grid;
    grid-template-columns: 1fr 70px 100px 36px;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

#invoiceModal .invoice-item-row input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

#invoiceModal .invoice-item-row input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#invoiceModal .btn-remove-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

#invoiceModal .btn-remove-item:hover {
    background: #fecaca;
}

/* Total Display */
#invoiceModal .invoice-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: #f1f5f9;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
}

#invoiceModal .invoice-total span:last-child {
    color: #6366f1;
    font-size: 1.25rem;
}

/* Required field indicator */
#invoiceModal .form-group label.required::after {
    content: ' *';
    color: #dc2626;
}

@media (max-width: 600px) {
    #invoiceModal .form-row {
        grid-template-columns: 1fr;
    }
    
    #invoiceModal .invoice-item-row {
        grid-template-columns: 1fr 60px 80px 32px;
    }
}


/* =============================================
   INVOICE MODAL - Clean Style
============================================= */
#invoiceModal .modal-container {
    max-width: 900px;
    width: 95%;
}

.invoice-form-container {
    padding: 1.5rem 2rem;
}

.invoice-section {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.invoice-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.invoice-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 1rem;
}

.invoice-row {
    display: grid;
    gap: 1rem;
}

.invoice-row-2 {
    grid-template-columns: 1fr 2fr;
}

.invoice-row-3 {
    grid-template-columns: 1.5fr 1fr 1fr;
}

.invoice-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.invoice-field label .required {
    color: #dc2626;
}

.invoice-field .form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
}

.invoice-field .form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.invoice-field .form-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Line Items - Shared Grid */
.line-items-header,
.line-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 40px;
    gap: 0.5rem;
    align-items: center;
}

.line-items-header {
    padding: 0.5rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
}

.line-items-header .required {
    color: #dc2626;
}

.line-items-header .col-qty,
.line-items-header .col-price {
    text-align: center;
}

.line-items-header .col-total {
    text-align: right;
}

.line-item-row {
    padding: 0.375rem 0;
}

.line-item-row .form-input {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.line-item-row .form-input:focus {
    outline: none;
    border-color: #6366f1;
}

.line-item-row .item-qty,
.line-item-row .item-price {
    text-align: center;
}

.line-item-row .item-total {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    text-align: right;
}

.btn-remove-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-remove-item:hover {
    background: #fecaca;
}

/* Totals */
.invoice-totals-section {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    margin: 0 -2rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: #64748b;
}

.totals-row.totals-final {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.totals-row.totals-kas {
    font-size: 0.8125rem;
    color: #9ca3af;
}

/* Modal Footer */
#invoiceModal .modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

#invoiceModal .modal-footer .btn-primary {
    background: #1a365d;
}

#invoiceModal .modal-footer .btn-primary:hover {
    background: #14284a;
}

@media (max-width: 640px) {
    .invoice-row-2,
    .invoice-row-3 {
        grid-template-columns: 1fr;
    }
    
    .line-items-header {
        display: none;
    }
    
    .line-items-header,
    .line-item-row {
        grid-template-columns: 1fr 60px 80px 32px;
    }
    
    .line-item-row .item-total {
        display: none;
    }
}

/* Confirm Modal */
#confirmModal .modal-container {
    max-width: 400px;
}

#confirmModal .modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
}

#confirmModal .modal-footer {
    justify-content: center;
    gap: 1rem;
}

/* =============================================
   PRODUCT MODAL v2
============================================= */

.modal-lg {
    width: 720px;
    max-width: 95vw;
}

/* Tabs */
.pm-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 24px;
    background: #f8fafc;
}

.pm-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
}

.pm-tab:hover {
    color: #1e293b;
}

.pm-tab.active {
    color: #4f46e5;
}

.pm-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4f46e5;
    border-radius: 2px 2px 0 0;
}

/* Panels */
.pm-panel {
    display: none;
}

.pm-panel.active {
    display: block;
}

/* Layout rows */
.pm-row {
    margin-bottom: 0;
}

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

/* Required asterisk */
.required {
    color: #ef4444;
}

/* USD input with $ prefix */
.input-with-prefix {
    position: relative;
}

.input-with-prefix .input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 15px;
    pointer-events: none;
}

.input-with-prefix input {
    padding-left: 30px !important;
}

/* KAS price display box */
.kas-price-display {
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kas-price-display .kas-amount {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.kas-price-display small {
    color: #64748b;
    margin-top: 2px;
}

/* Select styling (was missing) */
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px #eef2ff;
}

/* Main image upload area */
.pm-image-upload {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.pm-image-preview {
    width: 120px;
    height: 120px;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.pm-image-preview.has-image {
    border-style: solid;
    border-color: #e2e8f0;
}

.pm-image-preview i {
    font-size: 24px;
    margin-bottom: 4px;
}

.pm-image-preview span {
    font-size: 12px;
}

.pm-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-image-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pm-image-actions small {
    color: #94a3b8;
    font-size: 12px;
}

/* Ghost button variant */
.btn-ghost {
    background: none;
    border: none;
    color: #64748b;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
}

.btn-ghost:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Advanced tab hint */
.pm-section-hint {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #4f46e5;
}

/* Attribute sections */
.pm-attr-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #fafbfc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
}

.pm-attr-header {
    margin-bottom: 12px;
}

.pm-attr-header strong {
    font-size: 14px;
    color: #1e293b;
}

.pm-attr-header small {
    color: #94a3b8;
    margin-left: 6px;
}

.pm-attr-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* Attribute row: name + values + remove */
.pm-attr-row {
    display: grid;
    grid-template-columns: 1fr 2fr 32px;
    gap: 8px;
    align-items: center;
}

.pm-attr-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.pm-attr-row input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px #eef2ff;
}

/* Spec / feature row: just name + value + remove */
.pm-spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr 32px;
    gap: 8px;
    align-items: center;
}

.pm-spec-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.pm-spec-row input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px #eef2ff;
}

/* Feature row: single input + remove */
.pm-feature-row {
    display: grid;
    grid-template-columns: 1fr 32px;
    gap: 8px;
    align-items: center;
}

.pm-feature-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.pm-feature-row input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px #eef2ff;
}

/* Remove button in attr rows */
.pm-remove-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s;
}

.pm-remove-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

/* Extra images */
.pm-extra-images small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin: 6px 0 12px;
}

.pm-extra-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pm-extra-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.pm-extra-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pm-extra-thumb .pm-thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-extra-thumb .pm-thumb-remove:hover {
    background: #ef4444;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .modal-lg {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .pm-row-2col {
        grid-template-columns: 1fr;
    }

    .pm-attr-row {
        grid-template-columns: 1fr 1fr 32px;
    }

    .pm-image-upload {
        flex-direction: column;
        align-items: stretch;
    }

    .pm-image-preview {
        width: 100%;
        height: 160px;
    }
}

/* ========== WALLET SETUP (Registration) ========== */

.need-wallet-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    user-select: none;
}

.need-wallet-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #49eacb;
    cursor: pointer;
}

.need-wallet-toggle span {
    font-weight: 500;
}

.wallet-setup-panel {
    margin-top: 14px;
    animation: walletSlideDown 0.2s ease;
}

@keyframes walletSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wallet-provider-card {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.wallet-provider-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wallet-provider-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.wallet-provider-header strong {
    display: block;
    font-size: 14px;
}

.wallet-provider-header small {
    color: #64748b;
    font-size: 12px;
}

.wallet-provider-fields {
    padding: 16px;
}

.wallet-provider-fields .form-group {
    margin-bottom: 14px;
}

.wallet-provider-fields .form-group:last-of-type {
    margin-bottom: 8px;
}

.wallet-setup-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: #f0f9ff;
    border-radius: 8px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-top: 4px;
}

.wallet-setup-note i {
    color: #0ea5e9;
    margin-top: 2px;
    flex-shrink: 0;
}

.wallet-created-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    margin-bottom: 16px;
}

.wallet-created-notice i {
    color: #22c55e;
    font-size: 18px;
    margin-top: 2px;
}

.wallet-created-notice strong {
    display: block;
    margin-bottom: 2px;
}

.wallet-created-notice small {
    color: #64748b;
    font-size: 12px;
}


