/* HarshAffiliatePro public styles — Author: Harsh Pan (harshpan.com) */

.hap-frontend {
    --hap-primary: #3582c4;
    --hap-primary-dark: #2271b1;
    --hap-border: #e2e4e7;
    --hap-muted: #646970;
    --hap-bg: #f6f7f7;
    --hap-radius: 8px;
    color: #1d2327;
    font-size: 15px;
    line-height: 1.6;
    max-width: 1000px;
    margin: 1.5em auto;
}
.hap-frontend * { box-sizing: border-box; }
.hap-frontend .hap-muted { color: var(--hap-muted); }
.hap-frontend .hap-desc { font-size: 13px; color: var(--hap-muted); margin: 4px 0 0; }
.hap-frontend .hap-req { color: #b32d2e; }

/* Notices */
.hap-frontend .hap-notice {
    padding: 12px 16px;
    border-radius: var(--hap-radius);
    margin: 0 0 16px;
    border-left: 4px solid transparent;
    font-size: 14px;
}
.hap-notice-success { background: #edfaef; border-left-color: #00a32a; }
.hap-notice-error   { background: #fcf0f1; border-left-color: #b32d2e; }
.hap-notice-info    { background: #f0f6fc; border-left-color: #3582c4; }

/* Cards */
.hap-frontend .hap-card {
    background: #fff;
    border: 1px solid var(--hap-border);
    border-radius: var(--hap-radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.hap-frontend .hap-card h3,
.hap-frontend .hap-card h4 { margin: 0 0 12px; }
.hap-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.hap-card-stat .hap-stat-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--hap-muted); }
.hap-card-stat .hap-stat-value { display: block; font-size: 22px; font-weight: 600; margin-top: 2px; }

/* Grid */
.hap-frontend .hap-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 782px) { .hap-frontend .hap-grid-2 { grid-template-columns: 1fr; } }

/* Buttons */
.hap-frontend .hap-btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--hap-border);
    border-radius: 6px;
    background: #fff;
    color: #1d2327;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.5;
}
.hap-frontend .hap-btn:hover { background: var(--hap-bg); }
.hap-frontend .hap-btn-primary { background: var(--hap-primary); border-color: var(--hap-primary-dark); color: #fff; }
.hap-frontend .hap-btn-primary:hover { background: var(--hap-primary-dark); color: #fff; }

/* Forms */
.hap-frontend .hap-field { margin-bottom: 14px; }
.hap-frontend .hap-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.hap-frontend input[type="text"],
.hap-frontend input[type="email"],
.hap-frontend input[type="password"],
.hap-frontend input[type="url"],
.hap-frontend input[type="number"],
.hap-frontend select,
.hap-frontend textarea {
    width: 100%;
    max-width: 480px;
    padding: 8px 10px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    font-size: 14px;
}
.hap-frontend textarea { max-width: 640px; }
.hap-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .hap-field-row { grid-template-columns: 1fr; } }
.hap-frontend .hap-terms label { font-weight: 400; }

/* Honeypot (hidden from humans, invisible to most bots' layout logic) */
.hap-frontend .hap-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px; height: 1px; overflow: hidden;
}

/* Conditional payment fields */
.hap-frontend .hap-pay-fields { display: none; }
.hap-frontend .hap-pay-fields.active { display: block; }

/* Login form */
.hap-frontend .hap-login-links { font-size: 13px; margin-top: 10px; }
.hap-frontend .login-remember { margin: 10px 0; }

/* Tables */
.hap-frontend table.hap-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.hap-frontend table.hap-table th,
.hap-frontend table.hap-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f1;
    text-align: left;
    font-size: 14px;
}
.hap-frontend table.hap-table th { font-weight: 600; }
.hap-stats-table th { width: 45%; }

/* Badges */
.hap-frontend .hap-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.hap-badge-pending    { background: #f0b33a; color: #1d2327; }
.hap-badge-active     { background: #00a32a; }
.hap-badge-approved   { background: #199f8c; }
.hap-badge-paid       { background: #00a32a; }
.hap-badge-rejected   { background: #8c8f94; }
.hap-badge-suspended  { background: #e08214; }
.hap-badge-banned     { background: #b32d2e; }
.hap-badge-processing { background: #72aee6; color: #1d2327; }
.hap-badge-failed     { background: #b32d2e; }

/* Dashboard */
.hap-dash-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.hap-dash-header h2 { margin: 0; }
.hap-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--hap-border);
    margin-bottom: 0;
}
.hap-tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--hap-muted);
}
.hap-tab-btn:hover { color: var(--hap-primary); }
.hap-tab-btn.active { color: var(--hap-primary); border-bottom-color: var(--hap-primary); }
.hap-panel { display: none; padding-top: 16px; }
.hap-panel.active { display: block; }

/* Copy rows */
.hap-copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.hap-copy-input { flex: 1; min-width: 240px; max-width: none !important; font-family: monospace; font-size: 13px; background: var(--hap-bg); }

/* QR */
.hap-frontend .hap-qr { display: block; margin: 12px 0; max-width: 220px; height: auto; background: #fff; padding: 4px; border: 1px solid var(--hap-border); border-radius: 6px; }

/* Progress */
.hap-progress { height: 10px; background: var(--hap-bg); border-radius: 6px; overflow: hidden; margin: 8px 0; }
.hap-progress-bar { height: 100%; background: #00a32a; border-radius: 6px; transition: width 0.4s; }

/* Chart */
.hap-chart-legend { display: flex; gap: 16px; font-size: 12px; margin-bottom: 8px; }
.hap-chart-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#hap-chart svg { width: 100%; height: auto; display: block; }

/* Filters & pagination */
.hap-filter-links { margin-bottom: 12px; }
.hap-filter-link { display: inline-block; padding: 4px 12px; margin-right: 4px; border: 1px solid var(--hap-border); border-radius: 14px; text-decoration: none; font-size: 13px; color: var(--hap-muted); }
.hap-filter-link.active { background: var(--hap-primary); border-color: var(--hap-primary-dark); color: #fff; }
.hap-pagination { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* Banners */
.hap-banner img { max-width: 100%; height: auto; border-radius: 6px; }
.hap-banner textarea { font-family: monospace; font-size: 12px; background: var(--hap-bg); }

/* Status screen */
.hap-status-screen { text-align: center; padding: 36px 20px; }

@media (max-width: 600px) {
    .hap-frontend .hap-tabs { overflow-x: auto; }
    .hap-copy-input { min-width: 160px; }
}

/* Update L: registration channels + profile */
.hap-frontend .hap-channels { margin: 12px 0; }
.hap-frontend .hap-channel-check {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; margin: 0 6px 6px 0;
    border: 1px solid var(--hap-border); border-radius: 16px;
    font-size: 13px; cursor: pointer; background: #fff;
}
.hap-frontend .hap-channel-check:has(input:checked) { background: #f0f6fc; border-color: #3582c4; }
.hap-frontend .hap-profile-row img { border-radius: 50%; object-fit: cover; }