/**
 * KP Referidos Pro — Dashboard Styles
 * Brand: Montserrat, #0C2134 (dark), #F2780C (orange), #65BFB6 (teal)
 * NO border-radius anywhere.
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --kpref-dark: #0C2134;
    --kpref-dark-light: #163150;
    --kpref-dark-lighter: #1e3f62;
    --kpref-orange: #F2780C;
    --kpref-orange-light: #FFF3E8;
    --kpref-orange-hover: #e06d07;
    --kpref-teal: #65BFB6;
    --kpref-teal-light: #E8F7F5;
    --kpref-teal-dark: #4da89f;
    --kpref-red: #dc3545;
    --kpref-red-light: #FDE8EA;
    --kpref-gray-50: #FAFAFA;
    --kpref-gray-100: #F5F5F5;
    --kpref-gray-200: #EEEEEE;
    --kpref-gray-300: #E0E0E0;
    --kpref-gray-400: #BDBDBD;
    --kpref-gray-500: #9E9E9E;
    --kpref-gray-600: #757575;
    --kpref-gray-700: #616161;
    --kpref-white: #FFFFFF;
    --kpref-font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --kpref-shadow-sm: 0 1px 3px rgba(12, 33, 52, 0.08);
    --kpref-shadow: 0 2px 8px rgba(12, 33, 52, 0.1);
    --kpref-shadow-lg: 0 4px 16px rgba(12, 33, 52, 0.12);
    --kpref-transition: 0.2s ease;
}

/* ============================================
   Base / Reset
   ============================================ */
.kpref-dashboard,
.kpref-login-prompt,
.kpref-apply,
.kpref-notice {
    font-family: var(--kpref-font);
    color: var(--kpref-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.kpref-dashboard *,
.kpref-login-prompt *,
.kpref-apply *,
.kpref-notice * {
    box-sizing: border-box;
    border-radius: 0 !important;
}

/* ============================================
   Login Prompt
   ============================================ */
.kpref-login-prompt {
    max-width: 480px;
    margin: 60px auto;
    text-align: center;
    padding: 48px 32px;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow);
}

.kpref-login-prompt__icon {
    margin-bottom: 24px;
}

.kpref-login-prompt h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--kpref-dark);
}

.kpref-login-prompt p {
    font-size: 15px;
    color: var(--kpref-gray-600);
    margin: 0 0 28px;
}

/* ============================================
   Notice Screens (Pending / Suspended)
   ============================================ */
.kpref-notice {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
    padding: 48px 32px;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow);
}

.kpref-notice--pending {
    border-top: 3px solid var(--kpref-orange);
}

.kpref-notice--suspended {
    border-top: 3px solid var(--kpref-red);
}

.kpref-notice__icon {
    margin-bottom: 24px;
}

.kpref-notice h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px;
}

.kpref-notice p {
    font-size: 15px;
    color: var(--kpref-gray-600);
    margin: 0;
}

/* ============================================
   Application Form
   ============================================ */
.kpref-apply {
    max-width: 600px;
    margin: 40px auto;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow);
}

.kpref-apply__header {
    padding: 32px 32px 0;
}

.kpref-apply__header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--kpref-dark);
}

.kpref-apply__header p {
    font-size: 14px;
    color: var(--kpref-gray-600);
    margin: 0;
}

.kpref-apply__form {
    padding: 24px 32px 32px;
}

/* ============================================
   Forms
   ============================================ */
.kpref-form-row {
    margin-bottom: 20px;
}

.kpref-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--kpref-dark);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpref-form-row input[type="text"],
.kpref-form-row input[type="email"],
.kpref-form-row input[type="url"],
.kpref-form-row textarea,
.kpref-select {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--kpref-font);
    font-size: 14px;
    color: var(--kpref-dark);
    background: var(--kpref-gray-50);
    border: 1px solid var(--kpref-gray-300);
    outline: none;
    transition: border-color var(--kpref-transition), box-shadow var(--kpref-transition);
}

.kpref-form-row input:focus,
.kpref-form-row textarea:focus,
.kpref-select:focus {
    border-color: var(--kpref-orange);
    box-shadow: 0 0 0 3px rgba(242, 120, 12, 0.12);
    background: var(--kpref-white);
}

.kpref-form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.kpref-form-hint {
    display: block;
    font-size: 12px;
    color: var(--kpref-gray-500);
    margin-top: 4px;
}

.kpref-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
}

.kpref-form-message--success {
    background: var(--kpref-teal-light);
    border: 1px solid var(--kpref-teal);
    color: var(--kpref-dark);
}

.kpref-form-message--error {
    background: var(--kpref-red-light);
    border: 1px solid var(--kpref-red);
    color: var(--kpref-red);
}

/* ============================================
   Buttons
   ============================================ */
.kpref-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--kpref-font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--kpref-transition);
    text-decoration: none;
    line-height: 1.4;
}

.kpref-btn--primary {
    background: var(--kpref-orange);
    color: var(--kpref-white);
}

.kpref-btn--primary:hover {
    background: var(--kpref-orange-hover);
    transform: translateY(-1px);
    box-shadow: var(--kpref-shadow);
}

.kpref-btn--lg {
    padding: 14px 28px;
    font-size: 15px;
}

.kpref-btn--disabled {
    background: var(--kpref-gray-300);
    color: var(--kpref-gray-500);
    cursor: not-allowed;
}

.kpref-btn--stripe {
    background: var(--kpref-dark);
    color: var(--kpref-white);
    padding: 12px 24px;
}

.kpref-btn--stripe:hover {
    background: var(--kpref-dark-light);
}

/* ============================================
   Dashboard Header
   ============================================ */
.kpref-dashboard {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

.kpref-dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow-sm);
    margin-bottom: 0;
}

.kpref-dashboard__header-left {
    display: flex;
    align-items: center;
}

.kpref-dashboard__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kpref-dashboard__brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--kpref-orange-light);
    border: 1px solid rgba(242, 120, 12, 0.2);
}

.kpref-dashboard__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--kpref-dark);
    line-height: 1.2;
}

.kpref-dashboard__welcome {
    font-size: 13px;
    color: var(--kpref-gray-600);
}

.kpref-dashboard__header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.kpref-dashboard__code-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 6px 14px;
    background: var(--kpref-dark);
}

.kpref-dashboard__code-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.kpref-dashboard__code-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--kpref-orange);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.kpref-dashboard__notif-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--kpref-gray-50);
    border: 1px solid var(--kpref-gray-200);
    cursor: pointer;
    color: var(--kpref-dark);
    transition: all var(--kpref-transition);
}

.kpref-dashboard__notif-btn:hover {
    background: var(--kpref-gray-100);
    border-color: var(--kpref-gray-300);
}

.kpref-dashboard__notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpref-orange);
    color: var(--kpref-white);
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
}

/* ============================================
   Tabs
   ============================================ */
.kpref-dashboard__tabs {
    display: flex;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    border-top: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kpref-dashboard__tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    font-family: var(--kpref-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--kpref-gray-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all var(--kpref-transition);
    white-space: nowrap;
    cursor: pointer;
}

.kpref-dashboard__tab:hover {
    color: var(--kpref-dark);
    background: var(--kpref-gray-50);
}

.kpref-dashboard__tab--active {
    color: var(--kpref-orange);
    border-bottom-color: var(--kpref-orange);
}

.kpref-dashboard__tab--active:hover {
    color: var(--kpref-orange);
}

.kpref-dashboard__tab-icon {
    display: flex;
    align-items: center;
}

/* ============================================
   Content Area
   ============================================ */
.kpref-dashboard__content {
    margin-top: 24px;
}

/* ============================================
   Stats Grid
   ============================================ */
.kpref-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpref-stats-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.kpref-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow-sm);
    transition: box-shadow var(--kpref-transition), transform var(--kpref-transition);
}

.kpref-stat-card:hover {
    box-shadow: var(--kpref-shadow);
    transform: translateY(-1px);
}

.kpref-stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.kpref-stat-card__icon--referrals {
    background: var(--kpref-orange-light);
    color: var(--kpref-orange);
}

.kpref-stat-card__icon--earnings {
    background: var(--kpref-teal-light);
    color: var(--kpref-teal-dark);
}

.kpref-stat-card__icon--pending {
    background: var(--kpref-orange-light);
    color: var(--kpref-orange);
}

.kpref-stat-card__icon--paid {
    background: var(--kpref-teal-light);
    color: var(--kpref-teal-dark);
}

.kpref-stat-card__data {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kpref-stat-card__number {
    font-size: 22px;
    font-weight: 700;
    color: var(--kpref-orange);
    line-height: 1.2;
}

.kpref-stat-card__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--kpref-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Panels
   ============================================ */
.kpref-panel {
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow-sm);
    margin-bottom: 24px;
    padding: 24px;
}

.kpref-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.kpref-panel__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--kpref-dark);
    margin: 0 0 20px;
}

.kpref-panel__header .kpref-panel__title {
    margin-bottom: 0;
}

.kpref-panel__desc {
    font-size: 14px;
    color: var(--kpref-gray-600);
    margin: -12px 0 24px;
}

/* ============================================
   Overview Grid
   ============================================ */
.kpref-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============================================
   Referral Link Box
   ============================================ */
.kpref-referral-link {
    margin-bottom: 24px;
}

.kpref-referral-link__row {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.kpref-referral-link__input {
    flex: 1;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background: var(--kpref-gray-50);
    border: 1px solid var(--kpref-gray-300);
    color: var(--kpref-dark);
    outline: none;
}

.kpref-referral-link__input:focus {
    border-color: var(--kpref-orange);
    box-shadow: 0 0 0 3px rgba(242, 120, 12, 0.12);
}

.kpref-referral-link__copy {
    flex-shrink: 0;
    border: 1px solid var(--kpref-orange);
    border-left: none;
}

.kpref-referral-link__copy--copied {
    background: var(--kpref-teal) !important;
    border-color: var(--kpref-teal) !important;
}

.kpref-referral-link__meta {
    font-size: 13px;
    color: var(--kpref-gray-500);
}

.kpref-referral-link__sep {
    margin: 0 8px;
}

/* ============================================
   Chart
   ============================================ */
.kpref-chart-panel .kpref-panel__title {
    margin-bottom: 16px;
}

.kpref-chart-wrapper {
    width: 100%;
    overflow: hidden;
}

.kpref-chart-wrapper canvas {
    width: 100% !important;
    height: auto !important;
}

/* ============================================
   Tables
   ============================================ */
.kpref-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.kpref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.kpref-table thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kpref-gray-500);
    background: var(--kpref-gray-50);
    border-bottom: 2px solid var(--kpref-gray-200);
    text-align: left;
    white-space: nowrap;
}

.kpref-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--kpref-gray-100);
    vertical-align: middle;
}

.kpref-table tbody tr:hover {
    background: var(--kpref-gray-50);
}

.kpref-table tbody tr:last-child td {
    border-bottom: none;
}

.kpref-table__right {
    text-align: right !important;
}

.kpref-table__center {
    text-align: center !important;
}

.kpref-table__date {
    white-space: nowrap;
    color: var(--kpref-gray-600);
    font-size: 13px;
}

.kpref-table__email {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kpref-table__amount {
    font-weight: 700;
    color: var(--kpref-orange);
}

.kpref-table__bold {
    font-weight: 600;
}

.kpref-table__mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--kpref-gray-600);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Badges
   ============================================ */
.kpref-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.kpref-badge--pending {
    background: transparent;
    border: 1px solid var(--kpref-orange);
    color: var(--kpref-orange);
}

.kpref-badge--approved {
    background: var(--kpref-teal);
    color: var(--kpref-white);
}

.kpref-badge--paid {
    background: var(--kpref-dark);
    color: var(--kpref-white);
}

.kpref-badge--rejected {
    background: var(--kpref-red);
    color: var(--kpref-white);
}

.kpref-badge--info {
    background: var(--kpref-orange-light);
    color: var(--kpref-orange);
    font-size: 10px;
}

/* Payout-specific badges */
.kpref-badge--payout-pending {
    background: transparent;
    border: 1px solid var(--kpref-orange);
    color: var(--kpref-orange);
}

.kpref-badge--payout-processing {
    background: transparent;
    border: 1px solid var(--kpref-teal);
    color: var(--kpref-teal-dark);
}

.kpref-badge--payout-completed {
    background: var(--kpref-teal);
    color: var(--kpref-white);
}

.kpref-badge--payout-failed {
    background: var(--kpref-red);
    color: var(--kpref-white);
}

/* ============================================
   Pagination
   ============================================ */
.kpref-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0 4px;
}

.kpref-pagination__btn {
    padding: 8px 16px;
    font-family: var(--kpref-font);
    font-size: 13px;
    font-weight: 600;
    color: var(--kpref-dark);
    background: var(--kpref-gray-50);
    border: 1px solid var(--kpref-gray-300);
    text-decoration: none;
    transition: all var(--kpref-transition);
}

.kpref-pagination__btn:hover {
    background: var(--kpref-orange);
    color: var(--kpref-white);
    border-color: var(--kpref-orange);
}

.kpref-pagination__info {
    font-size: 13px;
    color: var(--kpref-gray-500);
    font-weight: 500;
}

/* ============================================
   Filter
   ============================================ */
.kpref-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpref-filter__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--kpref-gray-600);
}

.kpref-select {
    width: auto;
    min-width: 140px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

/* ============================================
   Empty State
   ============================================ */
.kpref-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.kpref-empty svg {
    margin-bottom: 16px;
}

.kpref-empty p {
    font-size: 14px;
    color: var(--kpref-gray-500);
    margin: 0;
    max-width: 320px;
}

/* ============================================
   Payouts Header
   ============================================ */
.kpref-payout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px;
    background: var(--kpref-white);
    border: 1px solid var(--kpref-gray-200);
    box-shadow: var(--kpref-shadow-sm);
    margin-bottom: 24px;
}

.kpref-payout-balance__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--kpref-gray-500);
    margin-bottom: 4px;
}

.kpref-payout-balance__amount {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--kpref-orange);
    line-height: 1.2;
}

.kpref-payout-balance__min {
    display: block;
    font-size: 12px;
    color: var(--kpref-gray-400);
    margin-top: 4px;
}

/* ============================================
   Payment Methods
   ============================================ */
.kpref-method {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.kpref-payout-ref {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--kpref-gray-500);
}

/* ============================================
   Settings — Method Selection
   ============================================ */
.kpref-method-select {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.kpref-method-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 2px solid var(--kpref-gray-200);
    background: var(--kpref-white);
    cursor: pointer;
    transition: all var(--kpref-transition);
}

.kpref-method-option:hover {
    border-color: var(--kpref-gray-400);
    background: var(--kpref-gray-50);
}

.kpref-method-option--active {
    border-color: var(--kpref-orange);
    background: var(--kpref-orange-light);
}

.kpref-method-option--active:hover {
    border-color: var(--kpref-orange);
    background: var(--kpref-orange-light);
}

.kpref-method-option input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--kpref-orange);
    width: 16px;
    height: 16px;
}

.kpref-method-option__content {
    flex: 1;
}

.kpref-method-option__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.kpref-method-option__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--kpref-dark);
}

.kpref-method-option__desc {
    font-size: 13px;
    color: var(--kpref-gray-600);
}

/* ============================================
   Settings Sections
   ============================================ */
.kpref-settings-section {
    padding: 20px 24px;
    background: var(--kpref-gray-50);
    border: 1px solid var(--kpref-gray-200);
    margin-bottom: 24px;
}

.kpref-settings-section__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--kpref-dark);
    margin: 0 0 12px;
}

.kpref-settings-section__hint {
    font-size: 13px;
    color: var(--kpref-gray-600);
    margin: 0 0 16px;
}

.kpref-stripe-connected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--kpref-teal-light);
    border: 1px solid var(--kpref-teal);
    font-size: 14px;
    font-weight: 500;
    color: var(--kpref-dark);
}

.kpref-settings-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 8px;
}

.kpref-settings-feedback {
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
}

.kpref-settings-feedback--success {
    background: var(--kpref-teal-light);
    color: var(--kpref-teal-dark);
}

.kpref-settings-feedback--error {
    background: var(--kpref-red-light);
    color: var(--kpref-red);
}

/* ============================================
   Text Utilities
   ============================================ */
.kpref-text--success {
    color: var(--kpref-teal-dark);
    font-weight: 600;
}

.kpref-text--warning {
    color: var(--kpref-orange);
    font-weight: 600;
}

.kpref-text--muted {
    color: var(--kpref-gray-400);
}

/* ============================================
   Loading State
   ============================================ */
.kpref-btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.kpref-btn--loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--kpref-white);
    animation: kpref-spin 0.6s linear infinite;
}

@keyframes kpref-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 1024px) {
    .kpref-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpref-stats-grid--3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .kpref-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 768px) {
    .kpref-dashboard {
        padding: 0 8px;
        margin: 16px auto;
    }

    .kpref-dashboard__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px 18px;
    }

    .kpref-dashboard__header-right {
        width: 100%;
        justify-content: space-between;
    }

    .kpref-dashboard__title {
        font-size: 17px;
    }

    .kpref-dashboard__tabs {
        overflow-x: auto;
    }

    .kpref-dashboard__tab {
        padding: 12px 14px;
        font-size: 12px;
    }

    .kpref-dashboard__tab-label {
        display: none;
    }

    .kpref-stats-grid,
    .kpref-stats-grid--3 {
        grid-template-columns: 1fr 1fr;
    }

    .kpref-stat-card {
        padding: 14px 16px;
    }

    .kpref-stat-card__number {
        font-size: 18px;
    }

    .kpref-stat-card__icon {
        width: 40px;
        height: 40px;
    }

    .kpref-panel {
        padding: 16px;
    }

    .kpref-referral-link__row {
        flex-direction: column;
    }

    .kpref-referral-link__copy {
        border-left: 1px solid var(--kpref-orange);
        width: 100%;
        justify-content: center;
    }

    .kpref-payout-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .kpref-payout-balance__amount {
        font-size: 26px;
    }

    .kpref-payout-action {
        width: 100%;
    }

    .kpref-payout-action .kpref-btn {
        width: 100%;
        justify-content: center;
    }

    .kpref-method-option {
        padding: 14px 16px;
    }

    .kpref-settings-section {
        padding: 16px;
    }

    .kpref-settings-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .kpref-settings-footer .kpref-btn {
        justify-content: center;
    }

    .kpref-filter {
        width: 100%;
    }

    .kpref-select {
        flex: 1;
    }

    .kpref-pagination {
        flex-wrap: wrap;
    }

    .kpref-apply {
        margin: 20px 8px;
    }

    .kpref-apply__header,
    .kpref-apply__form {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 480px) {
    .kpref-stats-grid,
    .kpref-stats-grid--3 {
        grid-template-columns: 1fr;
    }

    .kpref-dashboard__code-badge {
        padding: 4px 10px;
    }

    .kpref-dashboard__code-value {
        font-size: 14px;
    }
}

/* ─────────────────────────────────────────────────────────────
   MEGA PRO v1.4.0 — additions
   ───────────────────────────────────────────────────────────── */

.kpref-stats-grid--six {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
@media (max-width: 1100px) { .kpref-stats-grid--six { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .kpref-stats-grid--six { grid-template-columns: repeat(2, 1fr); } }

.kpref-stat-card__icon--clicks { background: #e8f4ff; color: #1d6fb8; }
.kpref-stat-card__icon--rate   { background: #f3e8ff; color: #7c3aed; }

.kpref-meta-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}
@media (max-width: 700px) { .kpref-meta-row { grid-template-columns: 1fr; } }
.kpref-meta-row__item {
    background: #fff;
    border: 1px solid #e6e9ed;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kpref-meta-row__label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.kpref-meta-row__value { font-size: 18px; font-weight: 700; color: #0C2134; font-family: Montserrat, sans-serif; }
.kpref-meta-row__hint  { font-size: 11px; color: #64748b; }

.kpref-transparency-note {
    display: flex; align-items: center; gap: 8px;
    background: #fff8ec;
    border: 1px solid #f3d8a8;
    color: #6b4a14;
    padding: 10px 12px;
    font-size: 13px;
    margin: 10px 0 18px;
}
.kpref-transparency-note svg { color: #F2780C; flex-shrink: 0; }
.kpref-transparency-note strong { color: #0C2134; }

.kpref-money-base {
    color: #64748b;
    font-weight: 400;
    font-size: 0.92em;
}
.kpref-text-muted { color: #64748b; }

.kpref-table--mega th,
.kpref-table--mega td { font-size: 13px; padding: 8px 10px; }
.kpref-table--mega .kpref-table__amount { font-weight: 700; }

.kpref-row-clickable { cursor: pointer; }
.kpref-row-clickable:hover { background: #fafbfc; }
.kpref-row-detail > td {
    background: #f7f9fb;
    border-top: 0;
    padding: 14px 16px;
}
.kpref-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.kpref-detail-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid #e6e9ed;
    padding: 8px 10px;
}
.kpref-detail-grid__label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.kpref-detail-grid > div strong {
    color: #0C2134;
    font-weight: 700;
    font-size: 14px;
}

.kpref-gateway-tag {
    display: inline-block;
    background: #eef2f7;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    letter-spacing: .04em;
}

.kpref-empty {
    text-align: center;
    padding: 36px 16px;
    color: #64748b;
}
.kpref-empty__title { font-size: 16px; font-weight: 700; color: #0C2134; margin: 8px 0 4px; }
.kpref-empty__text  { margin: 0 0 14px; font-size: 13px; }
.kpref-empty .kpref-btn { margin-top: 6px; }

.kpref-badge--refunded  { background: #fef2f2; color: #b91c1c; }
.kpref-badge--cancelled { background: #f1f5f9; color: #475569; }

/* Modal */
.kpref-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(12, 33, 52, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999;
    padding: 16px;
}
.kpref-modal {
    background: #fff;
    max-width: 480px;
    width: 100%;
    padding: 24px;
    border: 1px solid #e6e9ed;
    box-shadow: 0 16px 40px rgba(12,33,52,0.18);
    font-family: Montserrat, sans-serif;
}
.kpref-modal__title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0C2134;
}
.kpref-modal__body { font-size: 14px; color: #334155; line-height: 1.5; }
.kpref-modal__body dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 12px 0; }
.kpref-modal__body dt { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpref-modal__body dd { margin: 0; color: #0C2134; font-weight: 700; }
.kpref-modal__footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.kpref-btn--ghost {
    background: transparent;
    color: #0C2134;
    border: 1px solid #cbd5e0;
}
.kpref-btn--ghost:hover { background: #f1f5f9; }

#kpref-qr-canvas {
    margin: 12px auto;
    display: block;
    max-width: 240px;
    height: auto;
}

/* ─────────────────────────────────────────────────────────────
   v1.4.1 — pulido extra panel afiliado
   ───────────────────────────────────────────────────────────── */

/* Bottom padding so cookie banner / footer doesn't cover content */
body.kpref-affiliate-page,
.kpref-dashboard {
    padding-bottom: 120px !important;
}

/* Hero card: header con gradient sutil */
.kpref-dashboard__header {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%) !important;
    border-left: 4px solid #F2780C;
}

/* Codigo de afiliado: mas leible */
.kpref-dashboard__code-badge {
    background: #0C2134 !important;
    border: 1px solid #0C2134;
    box-shadow: 0 2px 8px rgba(12,33,52,0.15);
}
.kpref-dashboard__code-value {
    color: #F2780C !important;
    font-weight: 800;
    letter-spacing: 0.06em;
}

/* Icon-link box adjustments */
.kpref-referral-link__row {
    gap: 8px;
}
.kpref-qr-btn { padding: 10px 16px; }

/* Empty state: pulido */
.kpref-empty {
    padding: 50px 24px;
    background: #fafbfc;
    border: 2px dashed #e3e8ef;
}
.kpref-empty svg { opacity: .5; margin-bottom: 12px; }

/* Detail grid (expandible referido) — color del box */
.kpref-row-detail > td {
    background: linear-gradient(180deg, #fff8ec 0%, #fafbfc 60%) !important;
    border-top: 2px solid #F2780C !important;
}

/* Hover row visible */
.kpref-row-clickable {
    transition: background .12s;
}
.kpref-row-clickable:hover {
    background: #fff8ec !important;
}
.kpref-row-clickable td {
    position: relative;
}
.kpref-row-clickable td:first-child::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: transparent;
    transition: background .12s;
}
.kpref-row-clickable:hover td:first-child::before { background: #F2780C; }

/* Stat cards: hover lift */
.kpref-stat-card {
    transition: transform .15s, box-shadow .15s;
}
.kpref-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(12,33,52,0.08);
}

/* Tabs: visual feedback más fuerte */
.kpref-tabs-wrap a.is-active,
.kpref-tabs-wrap a[aria-selected="true"] {
    color: #F2780C !important;
    border-bottom-color: #F2780C !important;
}

/* Transparency note refined */
.kpref-transparency-note {
    border-radius: 0;
    line-height: 1.5;
}

/* Make Cookie banner shrink so it doesn't break fixed widths */
#cookie-notice,
.cli-modal-backdrop,
.cookie-bar,
.cookie-notice,
.cmplz-cookiebanner {
    max-height: 30vh;
}

/* ─────────────────────────────────────────────────────────────
   v1.5.0 — MEGA PRO Panel afiliado: hero, mini-grid, Stripe card
   ───────────────────────────────────────────────────────────── */

.kpref-greet {
    margin: 0 0 16px;
}
.kpref-greet__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: #0C2134;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.kpref-greet__subtitle {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* HERO de ganancias */
.kpref-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 0;
    background: linear-gradient(135deg, #0C2134 0%, #16304A 100%);
    color: #fff;
    border: 1px solid #0C2134;
    box-shadow: 0 6px 18px rgba(12,33,52,0.18);
    margin: 0 0 18px;
    overflow: hidden;
}
@media (max-width: 760px) {
    .kpref-hero { grid-template-columns: 1fr; }
}
.kpref-hero__primary {
    padding: 28px 32px;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 760px) {
    .kpref-hero__primary { border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 22px 22px; }
}
.kpref-hero__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #65BFB6;
    display: block;
    margin-bottom: 6px;
}
.kpref-hero__amount {
    font-size: 44px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
    .kpref-hero__amount { font-size: 34px; }
}
.kpref-hero__breakdown {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.kpref-hero__breakitem {
    display: flex;
    gap: 10px;
    align-items: center;
}
.kpref-hero__breakitem strong {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.kpref-hero__breakitem small {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.kpref-hero__breakdot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    margin-top: 4px;
}
.kpref-hero__breakdot--pending { background: #F2780C; }
.kpref-hero__breakdot--paid    { background: #65BFB6; }

.kpref-hero__secondary {
    background: rgba(255,255,255,0.04);
    padding: 22px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}
.kpref-hero__deal,
.kpref-hero__code {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kpref-hero__deal-label,
.kpref-hero__code-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.55);
}
.kpref-hero__deal-value {
    font-size: 28px;
    font-weight: 800;
    color: #F2780C;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.kpref-hero__deal-hint {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin-top: 4px;
}
.kpref-hero__code-value {
    font-family: 'Montserrat', monospace;
    font-size: 22px;
    font-weight: 800;
    color: #65BFB6;
    letter-spacing: 0.08em;
    background: rgba(0,0,0,0.25);
    padding: 6px 10px;
    display: inline-block;
    width: fit-content;
}

/* Mini grid (referidos / clicks / conversion / EPC) */
.kpref-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 0 18px;
}
@media (max-width: 900px) { .kpref-mini-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpref-mini-grid { grid-template-columns: 1fr; } }
.kpref-mini {
    background: #fff;
    border: 1px solid #e3e8ef;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(12,33,52,0.05);
    transition: transform .12s, box-shadow .12s;
}
.kpref-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(12,33,52,0.08);
}
.kpref-mini__icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: #fff1e0;
    color: #F2780C;
    flex-shrink: 0;
}
.kpref-mini__data { min-width: 0; }
.kpref-mini__data strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #0C2134;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.kpref-mini__data small {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

/* Stripe Connect card */
.kpref-stripe-card {
    background: #fff;
    border: 1px solid #e3e8ef;
    border-left: 4px solid #635bff;
    padding: 16px 20px;
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(12,33,52,0.05);
}
.kpref-stripe-card[data-connected="0"] { border-left-color: #d97706; }
.kpref-stripe-card.is-error           { border-left-color: #b91c1c; }
.kpref-stripe-card.is-warning         { border-left-color: #d97706; }
.kpref-stripe-card.is-success         { border-left-color: #22a06b; }

.kpref-stripe-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #635bff;
    flex-shrink: 0;
}
.kpref-stripe-card[data-connected="0"] .kpref-stripe-card__icon { color: #d97706; background: #fff8ec; }
.kpref-stripe-card.is-error .kpref-stripe-card__icon            { color: #b91c1c; background: #fef2f2; }
.kpref-stripe-card.is-warning .kpref-stripe-card__icon          { color: #d97706; background: #fff8ec; }
.kpref-stripe-card.is-success .kpref-stripe-card__icon          { color: #22a06b; background: #e8f7ef; }

.kpref-stripe-card__body { flex: 1; min-width: 220px; }
.kpref-stripe-card__title {
    font-size: 13px;
    font-weight: 700;
    color: #0C2134;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.kpref-stripe-card__status {
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
}
.kpref-stripe-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* General button styles unified (for the panel) */
.kpref-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .12s;
    white-space: nowrap;
}
.kpref-btn--primary {
    background: #F2780C; color: #fff; border-color: #F2780C;
    box-shadow: 0 1px 0 #C95E03;
}
.kpref-btn--primary:hover { background: #C95E03; border-color: #C95E03; color: #fff; transform: translateY(-1px); }
.kpref-btn--ghost {
    background: #fff; color: #0C2134; border-color: #cbd3dd;
}
.kpref-btn--ghost:hover { background: #f1f5f9; border-color: #0C2134; }
.kpref-btn--text {
    background: transparent; color: #64748b; padding-left: 6px; padding-right: 6px;
}
.kpref-btn--text:hover { color: #b91c1c; }
.kpref-btn[disabled] { opacity: .55; cursor: not-allowed; }



