/* ============================================================
   Edesigno Reseller Portal — portal.css
   Modern, Premium dark-sidebar layout matching design v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --rp-primary:      #122B46; /* TBA Navy */
    --rp-primary-hover:#1B3A5C; /* TBA Navy, lightened for hover */
    --rp-accent:       #16A34A; /* TBA Green */
    --rp-accent-hover: #15803D; /* TBA Green Dark */
    --rp-bg:           #EEF0F4; /* TBA Ground */
    --rp-card:         #ffffff;
    --rp-border:       #E2E8F0; /* TBA Border */
    --rp-text:         #0F213A; /* TBA Ink */
    --rp-muted:        #64748B; /* TBA Muted */
    
    --rp-success:      #166534; /* Green 800 */
    --rp-success-bg:   #dcfce7; /* Green 100 */
    --rp-danger:       #991b1b; /* Red 800 */
    --rp-danger-bg:    #ffe4e6; /* Red 100 */
    --rp-warning:      #9a3412; /* Orange 800 */
    --rp-warning-bg:   #ffedd5; /* Orange 100 */
    --rp-info-bg:      #f1f5f9; /* Slate 100 */
    --rp-info:         #475569; /* Slate 600 */

    --rp-radius:       20px;
    --rp-radius-sm:    12px;
    --rp-shadow:       0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 24px rgba(15, 23, 42, 0.04);
    --rp-shadow-md:    0 10px 28px rgba(15, 23, 42, 0.08);
    --rp-shadow-lg:    0 18px 40px rgba(15, 23, 42, 0.1);
}

/* ── Base & Page resets ──────────────────────────────────── */
body.reseller-account-dashboard,
body.reseller-credits-purchase,
body.reseller-credits-history,
body.reseller-account-billing,
body.reseller-learner-index,
body.reseller-learner-register,
body.reseller-user-index,
body.reseller-user-new {
    background: var(--rp-bg) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

body.reseller-account-dashboard .page-header,
body.reseller-account-dashboard .header.content,
body.reseller-account-dashboard .cp-header,
body.reseller-account-dashboard .sticky-wrapper,
body.reseller-account-dashboard #zoo-sticky-header,
body.reseller-account-dashboard .zoo-breadcrumbs,
body.reseller-account-dashboard .page-title-wrapper,
body.reseller-account-billing .page-header,
body.reseller-account-billing .header.content,
body.reseller-account-billing .cp-header,
body.reseller-account-billing .sticky-wrapper,
body.reseller-account-billing #zoo-sticky-header,
body.reseller-account-billing .zoo-breadcrumbs,
body.reseller-account-billing .page-title-wrapper,
body.reseller-credits-purchase .page-header,
body.reseller-credits-purchase .header.content,
body.reseller-credits-purchase .cp-header,
body.reseller-credits-purchase .sticky-wrapper,
body.reseller-credits-purchase #zoo-sticky-header,
body.reseller-credits-purchase .zoo-breadcrumbs,
body.reseller-credits-purchase .page-title-wrapper,
body.reseller-credits-history .page-header,
body.reseller-credits-history .header.content,
body.reseller-credits-history .cp-header,
body.reseller-credits-history .sticky-wrapper,
body.reseller-credits-history #zoo-sticky-header,
body.reseller-credits-history .zoo-breadcrumbs,
body.reseller-credits-history .page-title-wrapper,
body.reseller-learner-index .page-header,
body.reseller-learner-index .header.content,
body.reseller-learner-index .cp-header,
body.reseller-learner-index .sticky-wrapper,
body.reseller-learner-index #zoo-sticky-header,
body.reseller-learner-index .zoo-breadcrumbs,
body.reseller-learner-index .page-title-wrapper,
body.reseller-learner-register .page-header,
body.reseller-learner-register .header.content,
body.reseller-learner-register .cp-header,
body.reseller-learner-register .sticky-wrapper,
body.reseller-learner-register #zoo-sticky-header,
body.reseller-learner-register .zoo-breadcrumbs,
body.reseller-learner-register .page-title-wrapper,
body.reseller-user-index .page-header,
body.reseller-user-index .header.content,
body.reseller-user-index .cp-header,
body.reseller-user-index .sticky-wrapper,
body.reseller-user-index #zoo-sticky-header,
body.reseller-user-index .zoo-breadcrumbs,
body.reseller-user-index .page-title-wrapper,
body.reseller-user-new .page-header,
body.reseller-user-new .header.content,
body.reseller-user-new .cp-header,
body.reseller-user-new .sticky-wrapper,
body.reseller-user-new #zoo-sticky-header,
body.reseller-user-new .zoo-breadcrumbs,
body.reseller-user-new .page-title-wrapper {
    display: none !important;
}

.rp-layout-container {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--rp-text);
    background: var(--rp-bg);
}

.rp-main-content {
    grid-area: main;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevents flex container overflow */
}

.rp-content {
    padding: 38px 34px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Sidebar Navigation ──────────────────────────────────── */
.rp-sidebar {
    grid-area: sidebar;
    width: 268px;
    background: var(--rp-primary);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 100;
}

.rp-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px 24px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 24px;
}

.rp-sidebar__logo {
    background: var(--rp-accent);
    color: #ffffff;
    font-weight: 800;
    font-size: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-sidebar__brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rp-sidebar__brand-name {
    font-weight: 700;
    font-size: 13px;
    color: #f8fafc;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 175px;
}

.rp-sidebar__brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 175px;
}

.rp-sidebar__menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rp-sidebar__section {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #94a3b8;
    margin: 24px 0 10px 14px;
}

.rp-sidebar__link,
.rp-sidebar__link:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #f8fafc !important;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.rp-sidebar__link:hover,
.rp-sidebar__link:focus {
    background: #1e293b;
    color: #f8fafc !important;
    text-decoration: none;
}

.rp-sidebar__link.is-active {
    background: var(--rp-accent);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.rp-sidebar__link .rp-icon {
    color: inherit !important;
}

.rp-sidebar__link.is-active .rp-icon {
    color: #ffffff;
}

.rp-sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid #1e293b;
}

.rp-sidebar__footer .rp-sidebar__link {
    color: #e2e8f0;
}

.rp-icon {
    width: 20px;
    height: 20px;
    color: inherit;
    flex-shrink: 0;
}

/* ── Top Bar Header ──────────────────────────────────────── */
.rp-topbar {
    grid-area: topbar;
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid var(--rp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 0 34px;
    box-sizing: border-box;
}

.rp-topbar__breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
}

.rp-topbar__root {
    color: var(--rp-muted);
}

.rp-topbar__separator {
    color: #cbd5e1;
}

.rp-topbar__current {
    color: var(--rp-text);
    font-weight: 600;
}

.rp-topbar__user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.rp-topbar__cart {
    position: relative;
    color: var(--rp-text);
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
}

.rp-topbar__cart:hover {
    color: var(--rp-text);
}

.rp-topbar__cart-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    background: var(--rp-accent);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-topbar__user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rp-topbar__user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-text);
    background: var(--rp-bg);
    padding: 9px 16px;
    border-radius: 999px;
    line-height: 1;
}

.rp-topbar__avatar {
    width: 42px;
    height: 42px;
    background: var(--rp-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Content Headings ───────────────────────────────────── */
.rp-page-head {
    margin-bottom: 10px;
}

.rp-page-title {
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--rp-text);
    margin: 0 0 6px 0;
}

.rp-page-subtitle {
    font-size: 16px;
    color: var(--rp-muted);
    margin: 0;
}

/* ── Stat cards ────────────────────────────────────────── */
.rp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 10px;
}

.rp-stat {
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    padding: 26px 24px;
    box-shadow: var(--rp-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}

.rp-stat--warning {
    border-color: var(--rp-accent);
}

.rp-stat__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rp-stat__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--rp-muted);
    text-transform: uppercase;
}

.rp-stat__icon {
    color: var(--rp-muted);
    width: 18px;
    height: 18px;
}

.rp-stat__value {
    font-size: 34px;
    font-weight: 700;
    color: var(--rp-text);
    line-height: 1.1;
}

.rp-stat__sub {
    font-size: 14px;
    color: var(--rp-muted);
    margin-top: 8px;
}

.rp-stat__sub a {
    color: var(--rp-accent-hover);
    font-weight: 600;
    text-decoration: none;
}
.rp-stat__sub a:hover {
    text-decoration: underline;
}

/* ── Banner (Dark Section) ──────────────────────────────── */
.rp-banner {
    background: var(--rp-primary);
    color: #ffffff;
    border-radius: var(--rp-radius);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rp-banner__left {
    display: flex;
    align-items: center;
    gap: 42px;
}

.rp-banner__title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--rp-accent);
    text-transform: uppercase;
}

.rp-banner__metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.rp-banner__value {
    font-size: 30px;
    font-weight: 700;
}

.rp-banner__label {
    font-size: 12px;
    color: #94a3b8;
}

.rp-banner__top-seller {
    display: flex;
    flex-direction: column;
}

.rp-banner__ts-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.rp-banner__ts-label {
    font-size: 11px;
    color: #64748b;
}

/* ── Card Blocks ────────────────────────────────────────── */
.rp-card {
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow);
    overflow: hidden;
}

.rp-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--rp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rp-card__title {
    font-size: 18px;
    font-weight: 800;
    color: var(--rp-text);
    margin: 0;
}

.rp-card__meta {
    font-size: 13px;
    color: var(--rp-muted);
}
.rp-card__meta-strong {
    color: var(--rp-accent-hover);
    font-weight: 700;
}

.rp-card__body {
    padding: 24px;
}

/* ── Table Layouts ──────────────────────────────────────── */
.rp-table-wrap {
    overflow-x: auto;
}

.rp-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.rp-table th {
    background: var(--rp-bg);
    padding: 14px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rp-muted);
    border-bottom: 1px solid var(--rp-border);
}

.rp-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--rp-border);
    color: #334155;
    vertical-align: middle;
}

.rp-table tbody tr:last-child td {
    border-bottom: none;
}

.rp-table td strong {
    color: var(--rp-text);
    font-weight: 600;
}

/* ── Badges & Statuses ───────────────────────────────────── */
.rp-page-messages:empty {
    display: none;
}

.rp-page-messages .messages {
    margin-bottom: 20px;
}

.rp-page-messages .message {
    padding: 12px 16px;
    border-radius: var(--rp-radius-sm);
    font-weight: 500;
    margin-bottom: 8px;
}

.rp-page-messages .message:before {
    display: none;
}

.rp-page-messages .message-success {
    background: var(--rp-success-bg);
    color: var(--rp-success);
}

.rp-page-messages .message-error {
    background: var(--rp-danger-bg);
    color: var(--rp-danger);
}

.rp-page-messages .message-notice,
.rp-page-messages .message-warning {
    background: var(--rp-warning-bg);
    color: var(--rp-warning);
}

.rp-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
}

.rp-badge--green {
    background: var(--rp-success-bg);
    color: var(--rp-success);
}

.rp-badge--red {
    background: var(--rp-danger-bg);
    color: var(--rp-danger);
}

.rp-badge--orange {
    background: var(--rp-warning-bg);
    color: var(--rp-warning);
}

.rp-badge--gray {
    background: var(--rp-info-bg);
    color: var(--rp-info);
}

/* ── Buttons ────────────────────────────────────────────── */
.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1.2;
}

.rp-btn:hover {
    text-decoration: none;
}

.rp-btn--primary {
    background: var(--rp-accent);
    color: #ffffff;
}

.rp-btn--primary:hover {
    background: var(--rp-accent-hover);
    color: #ffffff;
}

.rp-btn--outline {
    background: #ffffff;
    border-color: var(--rp-border);
    color: var(--rp-text);
}

.rp-btn--outline:hover {
    background: var(--rp-bg);
    border-color: #cbd5e1;
    color: var(--rp-text);
}

.rp-btn--dark {
    background: var(--rp-primary);
    color: #ffffff;
}

.rp-btn--dark:hover {
    background: var(--rp-primary-hover);
    color: #ffffff;
}

.rp-banner .rp-btn,
.rp-sidebar .rp-btn,
[class*="rp-"] .rp-btn--dark,
[class*="rp-"] .rp-btn--dark:visited {
    color: #ffffff;
}

.rp-btn--sm {
    padding: 10px 16px;
    font-size: 13px;
    border-radius: 14px;
}

.rp-btn--text-danger {
    background: transparent;
    border: none;
    color: var(--rp-danger);
    font-weight: 600;
    padding: 0;
}
.rp-btn--text-danger:hover {
    text-decoration: underline;
    background: transparent;
}

.rp-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Buy Credits Grid ───────────────────────────────────── */
.rp-bundle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.rp-bundle-card {
    background: #ffffff;
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    padding: 22px;
    box-shadow: var(--rp-shadow);
    display: flex;
    flex-direction: column;
}

.rp-bundle-card__hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.rp-bundle-card__avail-pill {
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--rp-info);
}

.rp-bundle-card__avail-lbl {
    font-size: 12px;
    color: var(--rp-muted);
}

.rp-bundle-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--rp-text);
    margin: 0 0 16px 0;
    line-height: 1.4;
    min-height: 48px;
}

.rp-bundle-card__price {
    font-size: 31px;
    font-weight: 700;
    color: var(--rp-text);
    margin-bottom: 12px;
}

.rp-bundle-card__meta {
    font-size: 12px;
    color: var(--rp-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    border-top: 1px solid var(--rp-border);
    padding-top: 12px;
}

.rp-bundle-card__qty-wrap {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.rp-bundle-card__qty-lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--rp-muted);
    text-transform: uppercase;
}

.rp-bundle-card__qty-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    padding: 0 12px;
    box-sizing: border-box;
    background: #f8fafc;
    font-size: 14px;
    color: var(--rp-text);
}

.rp-bundle-card__btn {
    width: 100%;
}

/* ── Register Learner Wizard ───────────────────────────── */
.rp-wizard {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.rp-wizard__step {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rp-wizard__step-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--rp-text);
    margin: 0;
}

.rp-wizard__step-sub {
    font-size: 13px;
    color: var(--rp-muted);
    margin: 0;
}

/* Scrollable course list */
.rp-course-list {
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.rp-course-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--rp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: #ffffff;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}

.rp-course-item:last-child {
    border-bottom: none;
}

.rp-course-item:hover {
    background: #f8fafc;
}

.rp-course-item.is-selected {
    background: #F0FDF4;
    border-left-color: #16a34a;
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.4);
}

.rp-course-item__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 45%;
    padding-right: 16px;
    min-width: 0;
}

.rp-course-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rp-text);
    line-height: 1.3;
}

.rp-course-item__sku {
    font-size: 12px;
    color: var(--rp-muted);
    line-height: 16px;
}

.rp-course-item__badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.rp-course-pill {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}

.rp-course-pill--seats {
    background: var(--rp-success-bg);
    color: var(--rp-success);
}
.rp-course-pill--seats.is-empty {
    background: var(--rp-danger-bg);
    color: var(--rp-danger);
}

.rp-course-pill--price {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.rp-course-pill--days {
    color: var(--rp-muted);
}

.rp-course-item__action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    margin-left: 20px;
    flex-shrink: 0;
    width: 96px;
}

.rp-course-item__days {
    font-size: 12px;
    color: var(--rp-muted);
    font-weight: 500;
    line-height: 16px;
    text-align: right;
    white-space: nowrap;
}

.rp-course-btn {
    width: 96px;
    height: 32px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: #16a34a;
    color: #ffffff;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.2;
}

.rp-course-btn:hover:not(:disabled) {
    background: #15803d;
    color: #ffffff;
}

.rp-course-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #cbd5e1;
    color: #64748b;
    border-color: transparent;
}

/* Form Styling */
.rp-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.rp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.rp-field label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rp-muted);
}

.rp-field input,
.rp-field select,
.rp-field textarea {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    padding: 0 12px;
    box-sizing: border-box;
    background: #ffffff;
    font-size: 14px;
    color: var(--rp-text);
    transition: border-color 0.15s;
}

.rp-field textarea {
    height: 94px;
    padding: 10px 12px;
}

.rp-field input:focus,
.rp-field select:focus,
.rp-field textarea:focus {
    outline: none;
    border-color: var(--rp-accent);
}

.rp-required {
    color: var(--rp-danger);
}

.rp-actions-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rp-border);
}

.rp-actions-subtext {
    font-size: 13px;
    color: var(--rp-muted);
}

/* ── Filters & Search ───────────────────────────────────── */
.rp-filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.rp-filter-form input {
    height: 44px;
    border: 1.5px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    padding: 0 16px;
    width: 320px;
    box-sizing: border-box;
}

.rp-filter-form select {
    height: 44px;
    border: 1.5px solid var(--rp-border);
    border-radius: var(--rp-radius-sm);
    padding: 0 12px;
    box-sizing: border-box;
    width: 180px;
}

/* ── Live Updates ───────────────────────────────────────── */
@keyframes rp-pulse {
    0%   { opacity: 1; transform: scale(1); }
    30%  { opacity: 0.55; transform: scale(1.08); color: var(--rp-accent); }
    100% { opacity: 1; transform: scale(1); }
}

.rp-live-pulse {
    animation: rp-pulse 0.7s ease-out forwards;
}

/* ── Responsive Queries ─────────────────────────────────── */
@media (max-width: 1024px) {
    .rp-layout-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "sidebar"
            "topbar"
            "main";
    }
    .rp-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 16px;
    }
    .rp-sidebar__brand {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .rp-sidebar__menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 0 0 0;
    }
    .rp-sidebar__section {
        display: none;
    }
    .rp-sidebar__footer {
        display: none;
    }
    .rp-topbar {
        padding: 0 20px;
    }
    .rp-content {
        padding: 20px;
    }
    .rp-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .rp-bundle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .rp-form-grid {
        grid-template-columns: 1fr;
    }
}

body.reseller-learner-register .rp-content > .rp-card {
    max-width: 1060px;
}

body.reseller-user-index .rp-content > .rp-card {
    max-width: 1100px;
}

/* Force standard theme wrappers to fill 100% viewport width and height */
body.reseller-account-dashboard .page-wrapper,
body.reseller-account-dashboard .page-main,
body.reseller-account-dashboard .page-main > .container,
body.reseller-account-dashboard .columns,
body.reseller-account-dashboard .column.main,
body.reseller-account-dashboard .main-content-wrapper,
body.reseller-account-dashboard .zoo-main-content-area,
body.reseller-credits-purchase .page-wrapper,
body.reseller-credits-purchase .page-main,
body.reseller-credits-purchase .page-main > .container,
body.reseller-credits-purchase .columns,
body.reseller-credits-purchase .column.main,
body.reseller-credits-purchase .main-content-wrapper,
body.reseller-credits-purchase .zoo-main-content-area,
body.reseller-credits-history .page-wrapper,
body.reseller-credits-history .page-main,
body.reseller-credits-history .page-main > .container,
body.reseller-credits-history .columns,
body.reseller-credits-history .column.main,
body.reseller-credits-history .main-content-wrapper,
body.reseller-credits-history .zoo-main-content-area,
body.reseller-learner-index .page-wrapper,
body.reseller-learner-index .page-main,
body.reseller-learner-index .page-main > .container,
body.reseller-learner-index .columns,
body.reseller-learner-index .column.main,
body.reseller-learner-index .main-content-wrapper,
body.reseller-learner-index .zoo-main-content-area,
body.reseller-learner-register .page-wrapper,
body.reseller-learner-register .page-main,
body.reseller-learner-register .page-main > .container,
body.reseller-learner-register .columns,
body.reseller-learner-register .column.main,
body.reseller-learner-register .main-content-wrapper,
body.reseller-learner-register .zoo-main-content-area,
body.reseller-user-index .page-wrapper,
body.reseller-user-index .page-main,
body.reseller-user-index .page-main > .container,
body.reseller-user-index .columns,
body.reseller-user-index .column.main,
body.reseller-user-index .main-content-wrapper,
body.reseller-user-index .zoo-main-content-area,
body.reseller-account-billing .page-wrapper,
body.reseller-account-billing .page-main,
body.reseller-account-billing .page-main > .container,
body.reseller-account-billing .columns,
body.reseller-account-billing .column.main,
body.reseller-account-billing .main-content-wrapper,
body.reseller-account-billing .zoo-main-content-area,
body.reseller-user-new .page-wrapper,
body.reseller-user-new .page-main,
body.reseller-user-new .page-main > .container,
body.reseller-user-new .columns,
body.reseller-user-new .column.main,
body.reseller-user-new .main-content-wrapper,
body.reseller-user-new .zoo-main-content-area {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

/* ── Auth Pages (Login & Register) ───────────────────────── */
.rp-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--rp-bg);
}

.rp-auth {
    background: var(--rp-card);
    padding: 48px;
    border-radius: var(--rp-radius);
    box-shadow: var(--rp-shadow-lg);
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid var(--rp-border);
}

.rp-auth--wide {
    max-width: 640px;
}

.rp-auth h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--rp-text);
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.rp-auth p {
    font-size: 15px;
    color: var(--rp-muted);
    margin: 0 0 32px 0;
    line-height: 1.5;
}

.rp-auth-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.rp-auth-form .field {
    display: block !important;
    margin-bottom: 24px !important;
    clear: both;
}

.rp-auth-form .field > .label,
.rp-auth-form label {
    display: block !important;
    width: 100% !important;
    float: none !important;
    text-align: left !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--rp-text) !important;
}

.rp-auth-form .field > .control {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.rp-auth-form .input-text,
.rp-auth-form input[type="text"],
.rp-auth-form input[type="email"],
.rp-auth-form input[type="password"] {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid var(--rp-border) !important;
    border-radius: var(--rp-radius-sm) !important;
    font-size: 15px !important;
    background: #f8fafc !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    height: auto !important;
    line-height: normal !important;
}

.rp-auth-form .input-text:focus,
.rp-auth-form input[type="text"]:focus,
.rp-auth-form input[type="email"]:focus,
.rp-auth-form input[type="password"]:focus {
    border-color: var(--rp-accent) !important;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15) !important;
    outline: none !important;
    background: #ffffff !important;
}

.rp-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.rp-auth__submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 8px;
    border-radius: var(--rp-radius-sm);
}

.rp-auth__hint {
    font-size: 13px;
    color: var(--rp-muted);
    text-align: left;
    margin-top: -8px;
    margin-bottom: 24px;
}

.rp-auth__footnote {
    margin-top: 32px;
    font-size: 15px;
    color: var(--rp-muted);
    padding-top: 24px;
    border-top: 1px solid var(--rp-border);
}

.rp-auth__footnote a {
    color: var(--rp-accent-hover); /* TBA green dark */
    font-weight: 700;
    text-decoration: none;
    transition: color 0.15s;
}

.rp-auth__footnote a:hover {
    color: #14532D; /* green 900 */
    text-decoration: underline;
}

@media (max-width: 640px) {
    .rp-auth-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .rp-auth {
        padding: 32px 24px;
    }
}

/* ── Billing Page ────────────────────────────────────────── */
.rp-billing-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}
.rp-profile-field {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--rp-border);
}
.rp-profile-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.rp-profile-field label {
    font-size: 13px;
    color: var(--rp-muted);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}
.rp-profile-field div {
    font-size: 15px;
    color: var(--rp-text);
    font-weight: 500;
}
@media (max-width: 768px) {
    .rp-billing-grid {
        grid-template-columns: 1fr;
    }
}
