:root {
    --fp-primary: #886cc0;
    --fp-primary-dark: #6f4fb0;
    --fp-primary-light: #f3effa;
    --fp-bg: #f5f3fa;
    --fp-card: #ffffff;
    --fp-text: #1f2937;
    --fp-muted: #6b7280;
    --fp-border: #ece8f4;
    --fp-success: #10b981;
    --fp-danger: #ef4444;
    --fp-warning: #f59e0b;
    --fp-sidebar-w: 270px;
}

* { box-sizing: border-box; }

body.fp-body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fp-bg);
    color: var(--fp-text);
    min-height: 100vh;
}

.fp-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.fp-sidebar {
    width: var(--fp-sidebar-w);
    background: var(--fp-card);
    border-right: 1px solid var(--fp-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 40;
    transition: transform .25s ease;
}

.fp-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--fp-border);
}
.fp-brand h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--fp-primary);
    letter-spacing: -0.02em;
}
.fp-brand p {
    margin: .25rem 0 0;
    font-size: .72rem;
    color: var(--fp-muted);
}

.fp-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0;
}
.fp-nav::-webkit-scrollbar { width: 5px; }
.fp-nav::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.fp-nav-section {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fp-muted);
    padding: .75rem 1.25rem .35rem;
    font-weight: 600;
}

.fp-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1.25rem;
    margin: 0 .5rem;
    border-radius: .5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: .875rem;
    transition: all .15s;
}
.fp-nav a i { width: 1.1rem; text-align: center; color: var(--fp-muted); }
.fp-nav a:hover { background: var(--fp-primary-light); color: var(--fp-primary); }
.fp-nav a:hover i { color: var(--fp-primary); }
.fp-nav a.active {
    background: linear-gradient(90deg, var(--fp-primary-light), transparent);
    color: var(--fp-primary);
    font-weight: 600;
}
.fp-nav a.active i { color: var(--fp-primary); }

.fp-sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--fp-border);
    background: #faf9fc;
}
.fp-sidebar-user .name { font-weight: 600; font-size: .85rem; }
.fp-sidebar-user .meta { font-size: .72rem; color: var(--fp-muted); }
.fp-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    margin-top: .5rem;
    overflow: hidden;
}
.fp-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--fp-primary), #b794f6);
    border-radius: 99px;
}

/* Main */
.fp-main {
    flex: 1;
    margin-left: var(--fp-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.fp-topbar {
    background: var(--fp-card);
    border-bottom: 1px solid var(--fp-border);
    padding: .85rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
}
.fp-menu-btn {
    display: none;
    border: none;
    background: var(--fp-primary-light);
    color: var(--fp-primary);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    cursor: pointer;
}
.fp-page-title { font-size: 1.15rem; font-weight: 600; margin: 0; }
.fp-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.fp-search input {
    width: 100%;
    padding: .55rem 1rem .55rem 2.5rem;
    border: 1px solid var(--fp-border);
    border-radius: .65rem;
    background: #faf9fc;
    font-size: .875rem;
}
.fp-search i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fp-muted);
}
.fp-topbar-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}
.fp-icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    border: none;
    background: var(--fp-primary-light);
    color: var(--fp-primary);
    cursor: pointer;
    position: relative;
}
.fp-icon-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--fp-danger);
    color: #fff;
    font-size: .6rem;
    padding: 1px 5px;
    border-radius: 99px;
}
.fp-wallet-pill {
    background: linear-gradient(135deg, var(--fp-primary), #a78bfa);
    color: #fff;
    padding: .45rem .9rem;
    border-radius: .5rem;
    font-size: .8rem;
    font-weight: 600;
}
.fp-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--fp-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
}

.fp-content {
    padding: 1.25rem 1.5rem 2rem;
    flex: 1;
}

/* Cards & components */
.fp-card {
    background: var(--fp-card);
    border-radius: 1rem;
    border: 1px solid var(--fp-border);
    box-shadow: 0 1px 3px rgba(136, 108, 192, .06);
}
.fp-card-pad { padding: 1.25rem; }

.fp-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.fp-stat {
    padding: 1rem 1.15rem;
}
.fp-stat label {
    display: block;
    font-size: .75rem;
    color: var(--fp-muted);
    margin-bottom: .35rem;
}
.fp-stat .val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fp-text);
}
.fp-stat .sub {
    font-size: .7rem;
    margin-top: .25rem;
}
.fp-stat .sub.up { color: var(--fp-success); }
.fp-stat .sub.down { color: var(--fp-danger); }

.fp-hero {
    background: linear-gradient(135deg, #7c5cbf 0%, #9b7cd4 50%, #b794f6 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.fp-hero h2 { margin: 0 0 .35rem; font-size: 1.35rem; }
.fp-hero p { margin: 0; opacity: .9; font-size: .875rem; }
.fp-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border-radius: .5rem;
    font-size: .8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
}
.fp-btn:hover { transform: translateY(-1px); }
.fp-btn-primary { background: #fff; color: var(--fp-primary); }
.fp-btn-outline { background: transparent; border: 1px solid rgba(255,255,255,.5); color: #fff; }
.fp-btn-purple { background: var(--fp-primary); color: #fff; }
.fp-btn-sm { padding: .4rem .75rem; font-size: .75rem; }

.fp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.fp-grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }

/* List items (emails/messages style) */
.fp-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.fp-list-header h3 { margin: 0; font-size: 1rem; }
.fp-list-header p { margin: .15rem 0 0; font-size: .75rem; color: var(--fp-muted); }

.fp-list-item {
    display: flex;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid #f3f4f6;
    align-items: flex-start;
}
.fp-list-item:last-child { border-bottom: none; }
.fp-list-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    color: #fff;
}
.fp-list-body { flex: 1; min-width: 0; }
.fp-list-body .title { font-weight: 600; font-size: .875rem; margin: 0 0 .2rem; }
.fp-list-body .desc { font-size: .75rem; color: var(--fp-muted); margin: 0; line-height: 1.4; }
.fp-list-meta { font-size: .7rem; color: var(--fp-muted); white-space: nowrap; }

.fp-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
.fp-quick-tile {
    padding: 1rem;
    border-radius: .75rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform .15s;
    border: 1px solid var(--fp-border);
}
.fp-quick-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(136,108,192,.12); }
.fp-quick-tile i { font-size: 1.25rem; margin-bottom: .5rem; display: block; }
.fp-quick-tile.mobile { background: linear-gradient(135deg, #ede9fe, #fff); color: #6d28d9; }
.fp-quick-tile.dth { background: linear-gradient(135deg, #ffedd5, #fff); color: #c2410c; }
.fp-quick-tile.wallet { background: linear-gradient(135deg, #d1fae5, #fff); color: #047857; }

/* BBPS service grid */
.fp-bbps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 1rem;
    padding: .5rem 0 1rem;
}
.fp-bbps-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    color: var(--fp-text);
    padding: .75rem .5rem;
    border-radius: .75rem;
    transition: transform .15s ease, background .15s ease;
}
.fp-bbps-item:hover {
    transform: translateY(-2px);
    background: #f8fafc;
}
.fp-bbps-item .icon-wrap {
    width: 3.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .65rem;
}
.fp-bbps-item .icon-wrap i {
    font-size: 2rem;
    color: #2563eb;
    line-height: 1;
}
.fp-bbps-item span {
    font-size: .78rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.35;
    color: #1e293b;
    max-width: 6.5rem;
}

/* Alerts inside content */
.fp-alert {
    padding: .75rem 1rem;
    border-radius: .5rem;
    margin-bottom: 1rem;
    font-size: .875rem;
}
.fp-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.fp-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Content area overrides for inner pages */
.fp-content .bg-white.rounded-xl,
.fp-content .bg-white.rounded-2xl {
    border-radius: 1rem !important;
    border: 1px solid var(--fp-border) !important;
    box-shadow: 0 1px 3px rgba(136, 108, 192, .06) !important;
}
.fp-content table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.fp-content table thead { background: #faf9fc; }
.fp-content table th,
.fp-content table td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--fp-border); }
.fp-content input,
.fp-content select,
.fp-content textarea {
    border: 1px solid var(--fp-border);
    border-radius: .5rem;
    padding: .5rem .75rem;
    font-size: .875rem;
}
.fp-content input:focus,
.fp-content select:focus,
.fp-content textarea:focus {
    outline: none;
    border-color: var(--fp-primary);
    box-shadow: 0 0 0 3px rgba(136, 108, 192, .15);
}

.fp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 35;
}

/* Recharge pages */
.fp-rc-wrap { max-width: 42rem; margin: 0 auto; }
.fp-rc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.fp-rc-head-left { display: flex; align-items: center; gap: .75rem; }
.fp-rc-back {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .5rem;
    background: var(--fp-primary-light);
    color: var(--fp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.fp-rc-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.fp-rc-head p { margin: .15rem 0 0; font-size: .8rem; color: var(--fp-muted); }
.fp-rc-balance {
    background: linear-gradient(135deg, var(--fp-primary), #a78bfa);
    color: #fff;
    padding: .5rem .9rem;
    border-radius: .65rem;
    font-size: .8rem;
    font-weight: 600;
}

.fp-rc-steps {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.fp-rc-step-dot {
    flex: 1;
    text-align: center;
    padding: .55rem .35rem;
    border-radius: .65rem;
    background: #faf9fc;
    border: 1px solid var(--fp-border);
    font-size: .7rem;
    font-weight: 600;
    color: var(--fp-muted);
}
.fp-rc-step-dot.active {
    background: var(--fp-primary-light);
    border-color: var(--fp-primary);
    color: var(--fp-primary);
}
.fp-rc-step-dot.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.fp-rc-card { margin-bottom: 1rem; overflow: hidden; }
.fp-rc-card-head {
    padding: .85rem 1.15rem;
    font-size: .85rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.fp-rc-card-head.mobile { background: linear-gradient(135deg, #7c5cbf, #9b7cd4); }
.fp-rc-card-head.plans { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.fp-rc-card-head.pay { background: linear-gradient(135deg, #047857, #10b981); }
.fp-rc-card-head.dth { background: linear-gradient(135deg, #c2410c, #f97316); }
.fp-rc-card-head.bbps { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.fp-rc-card-head.bbps-pay { background: linear-gradient(135deg, #047857, #10b981); }
.fp-rc-step-back {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: .35rem .65rem;
    border-radius: .4rem;
    cursor: pointer;
}
.fp-rc-step-back:hover { background: rgba(255,255,255,.3); }
.fp-rc-card-body { padding: 1.15rem; }

.fp-rc-input-row { display: flex; gap: .5rem; }
.fp-rc-input-row input { flex: 1; padding: .75rem 1rem; font-size: 1rem; letter-spacing: .05em; }
.fp-rc-field { margin-bottom: 1rem; }
.fp-rc-field label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .35rem;
}
.fp-rc-field input,
.fp-rc-field select {
    width: 100%;
    padding: .7rem .85rem;
    font-size: .9rem;
}
.fp-rc-hint { font-size: .72rem; color: var(--fp-muted); margin-top: .35rem; }

.fp-rc-operator {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, #f3effa, #faf9fc);
    border: 1px solid #ddd6fe;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.fp-rc-operator .tag {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fp-primary);
    font-weight: 700;
}
.fp-rc-operator .name { font-size: 1.1rem; font-weight: 700; margin: .15rem 0; }
.fp-rc-operator .meta { font-size: .78rem; color: var(--fp-muted); }
.fp-rc-operator-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: #fff;
    color: var(--fp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(136,108,192,.15);
}

.fp-rc-tabs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding-bottom: .35rem;
    margin-bottom: .75rem;
}
.fp-rc-tab {
    padding: .35rem .75rem;
    border-radius: 99px;
    border: 1px solid var(--fp-border);
    background: #faf9fc;
    font-size: .72rem;
    font-weight: 600;
    color: var(--fp-muted);
    cursor: pointer;
    white-space: nowrap;
}
.fp-rc-tab.active {
    background: var(--fp-primary);
    border-color: var(--fp-primary);
    color: #fff;
}

.fp-rc-plans { max-height: 20rem; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.fp-rc-plan {
    width: 100%;
    text-align: left;
    padding: .85rem;
    border-radius: .75rem;
    border: 1px solid var(--fp-border);
    background: #fff;
    cursor: pointer;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    transition: border-color .15s, background .15s;
}
.fp-rc-plan:hover {
    border-color: var(--fp-primary);
    background: var(--fp-primary-light);
}
.fp-rc-plan .amt {
    min-width: 4rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fp-primary);
}
.fp-rc-plan .amt small { display: block; font-size: .65rem; color: var(--fp-muted); font-weight: 500; }
.fp-rc-plan .info { flex: 1; min-width: 0; }
.fp-rc-plan .cat { font-size: .7rem; font-weight: 600; color: var(--fp-primary); }
.fp-rc-plan .desc { font-size: .72rem; color: var(--fp-muted); margin-top: .15rem; line-height: 1.35; }

.fp-rc-selected {
    padding: 1rem;
    border-radius: .75rem;
    background: linear-gradient(135deg, #7c5cbf, #9b7cd4);
    color: #fff;
    position: relative;
    margin-bottom: 1rem;
}
.fp-rc-selected .change {
    position: absolute;
    top: .75rem;
    right: .75rem;
    font-size: .68rem;
    padding: .25rem .6rem;
    border-radius: 99px;
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    cursor: pointer;
}
.fp-rc-selected .price { font-size: 1.75rem; font-weight: 700; margin: .25rem 0; }
.fp-rc-selected .lbl { font-size: .68rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }

.fp-rc-amount-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
    margin-bottom: .75rem;
}
.fp-rc-amt-btn {
    padding: .55rem .25rem;
    border-radius: .5rem;
    border: 1px solid var(--fp-border);
    background: #faf9fc;
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all .15s;
}
.fp-rc-amt-btn:hover,
.fp-rc-amt-btn.selected {
    border-color: var(--fp-primary);
    background: var(--fp-primary-light);
    color: var(--fp-primary);
}
.fp-rc-amt-btn.dth:hover,
.fp-rc-amt-btn.dth.selected {
    border-color: #f97316;
    background: #ffedd5;
    color: #c2410c;
}

.fp-rc-submit {
    width: 100%;
    padding: .9rem;
    border: none;
    border-radius: .65rem;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    margin-top: .5rem;
}
.fp-rc-submit.mobile { background: linear-gradient(135deg, #047857, #10b981); }
.fp-rc-submit.dth { background: linear-gradient(135deg, #c2410c, #f97316); }
.fp-rc-submit.bbps { background: linear-gradient(135deg, #2563eb, #1d4ed8); }

.fp-rc-bill-box {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: .65rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.fp-rc-bill-box .title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #047857;
    margin-bottom: .5rem;
}
.fp-rc-bill-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    font-size: .8rem;
    padding: .35rem 0;
    border-bottom: 1px dashed #bbf7d0;
}
.fp-rc-bill-row:last-child { border-bottom: none; }
.fp-rc-bill-row .key { color: var(--fp-muted); }
.fp-rc-bill-row .val { font-weight: 600; text-align: right; word-break: break-word; }
.fp-rc-bill-row.amount .val { font-size: 1.1rem; color: #047857; }


.fp-rc-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .8rem;
}
.fp-rc-switch a {
    color: var(--fp-primary);
    font-weight: 600;
    text-decoration: none;
}

.hidden { display: none !important; }

.fp-impersonate-bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #78350f;
    padding: .55rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .82rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 50;
}
.fp-impersonate-bar form { margin: 0; }

@media (max-width: 1024px) {
    .fp-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .fp-grid-2, .fp-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .fp-sidebar { transform: translateX(-100%); }
    .fp-sidebar.open { transform: translateX(0); }
    .fp-main { margin-left: 0; }
    .fp-menu-btn { display: flex; align-items: center; justify-content: center; }
    .fp-overlay.show { display: block; }
    .fp-search { display: none; }
    .fp-stat-grid { grid-template-columns: 1fr; }
    .fp-quick-grid { grid-template-columns: 1fr; }
}
