/* ============================================
   PAYLESOTHO - MASTER CUSTOM STYLES
   ============================================ */

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

:root {
    --sidebar-width: 260px;
    --primary-green: #04bb4a;
    --primary-dark: #02953b;
    --sidebar-bg: #0f1a1f;
    --card-shadow: 0 12px 30px rgba(0,0,0,0.05);
    --border-radius-card: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Nunito', sans-serif;
    background: #f4f7fc;
    color: #1f2a33;
}

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

#wrapper {
    display: flex;
    min-height: 100vh;
}

#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

#content {
    flex: 1;
}

.page-content {
    padding: 2rem 2rem 1rem;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    background-image: radial-gradient(circle at 10% 20%, #1a2e36 0%, #0b1419 100%);
    color: #e6edf3;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    transition: left 0.25s ease;
    border-right: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
    z-index: 1040;
}

.sidebar::-webkit-scrollbar { 
    width: 4px; 
}

.sidebar::-webkit-scrollbar-track { 
    background: transparent; 
}

.sidebar::-webkit-scrollbar-thumb { 
    background: #2b4a57; 
    border-radius: 10px; 
}

.sidebar-brand {
    padding: 1.6rem 1.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand .brand-icon {
    background: var(--primary-green);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 8px 16px rgba(4, 187, 74, 0.25);
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.3px;
    color: white;
}

.sidebar .nav-item {
    margin: 2px 12px;
    border-radius: 12px;
    transition: 0.15s;
}

.sidebar .nav-link {
    color: #b2c9d6;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.15s;
    text-decoration: none;
}

.sidebar .nav-link i, 
.sidebar .nav-link .bi {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: #7b9eb0;
}

.sidebar .nav-link:hover {
    background: rgba(4, 187, 74, 0.12);
    color: white;
}

.sidebar .nav-link:hover i {
    color: #04bb4a;
}

.sidebar .nav-item.active .nav-link {
    background: rgba(4, 187, 74, 0.18);
    color: white;
    font-weight: 600;
}

.sidebar .nav-item.active .nav-link i {
    color: #04bb4a;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06rem;
    color: #6d8a9c;
    padding: 1rem 1.5rem 0.3rem;
    font-weight: 600;
}

/* Flyout submenu */
.nav-item-flyout {
    position: relative;
}

.nav-item-flyout > .nav-link .submenu-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: transform 0.2s, opacity 0.15s;
}

.nav-item-flyout > .nav-link.flyout-active .submenu-arrow {
    opacity: 1;
    color: #04bb4a;
}

/* Desktop: fixed flyout to the right */
.flyout-menu {
    display: none;
    position: fixed;
    background: #16262e;
    border-radius: 12px;
    padding: 0.4rem 0;
    min-width: 210px;
    box-shadow: 4px 8px 24px rgba(0,0,0,0.5);
    z-index: 9999;
    list-style: none;
    margin: 0;
    border: 1px solid rgba(255,255,255,0.06);
}

.flyout-menu.flyout-open {
    display: block;
}

/* Mobile: inline expand inside sidebar */
@media (max-width: 991px) {
    .flyout-menu {
        position: static !important;
        box-shadow: none;
        border-radius: 8px;
        border: none;
        background: rgba(255,255,255,0.04);
        margin: 0 0 4px 0;
        padding: 0.2rem 0;
    }

    .flyout-menu li a {
        padding: 0.5rem 1rem 0.5rem 2.8rem;
        font-size: 0.85rem;
    }

    .nav-item-flyout > .nav-link.flyout-active .submenu-arrow {
        transform: rotate(90deg);
    }
}

.flyout-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 1.2rem;
    color: #b2c9d6;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: 0.15s;
    white-space: nowrap;
}

.flyout-menu li a:hover {
    background: rgba(4,187,74,0.12);
    color: #fff;
}

.flyout-menu li a i {
    color: #7b9eb0;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.flyout-menu li a:hover i {
    color: #04bb4a;
}

.nav-item-flyout:hover > .nav-link .submenu-arrow {
    opacity: 1;
    color: #04bb4a;
}

/* ============================================
   TOPBAR
   ============================================ */

.topbar {
    background: #ffffffdd;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    padding: 0.6rem 2rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar .nav-link {
    color: #1f2a33;
    font-weight: 500;
}

.topbar .dropdown-menu {
    border: none;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.08);
    padding: 0.5rem 0;
}

.topbar .dropdown-item {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.topbar .dropdown-item i {
    width: 20px;
    color: #6f8a9b;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: #eaf0f6;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f3a47;
    font-weight: 600;
}

/* ============================================
   DASHBOARD HEADER
   ============================================ */

.dashboard-header {
    background: linear-gradient(135deg, #172554 0%, #1d4ed8 100%);
    color: #fff;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
}

.dashboard-header h1 {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.dashboard-header p {
    margin: 0;
    opacity: .82;
}

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

.stat-card {
    background: white;
    border-radius: var(--border-radius-card);
    padding: 1.4rem 1.2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0,0,0,0.02);
    transition: 0.2s;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .10);
}

.stat-label {
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-value {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 750;
    line-height: 1.2;
    margin-top: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-meta {
    color: #94a3b8;
    font-size: .78rem;
    margin-top: 7px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-blue { background: #dbeafe; color: #2563eb; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-cyan { background: #cffafe; color: #0891b2; }

/* ============================================
   PANEL / CARD
   ============================================ */

.panel-card {
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .06);
    margin-bottom: 1.8rem;
}

.panel-card .card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
    padding: 18px 20px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

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

.provider-card {
    border: 0;
    border-radius: 16px;
    color: #fff;
    min-height: 180px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .10);
}

.provider-card.ecocash {
    background: linear-gradient(135deg, #047857, #10b981);
}

.provider-card.mpesa {
    background: linear-gradient(135deg, #991b1b, #ef4444);
}

.provider-card .provider-logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.provider-card .amount {
    font-size: 1.7rem;
    font-weight: 750;
    margin-top: 18px;
}

.provider-card .small-stat {
    font-size: .78rem;
    opacity: .85;
}

/* ============================================
   SUCCESS RATE
   ============================================ */

.success-rate {
    font-size: 2.2rem;
    font-weight: 750;
    color: #16a34a;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-bar {
    border-radius: 999px;
}

/* ============================================
   TRANSACTION TABLE
   ============================================ */

.table-card {
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.table-card .table {
    margin-bottom: 0;
}

.table-card thead th {
    background: #f8fafc;
    color: #64748b;
    border: 0;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    padding: 13px 14px;
    font-weight: 700;
}

.table-card tbody td {
    border-color: #f1f5f9;
    padding: 13px 14px;
    vertical-align: middle;
    font-size: .86rem;
    color: #334155;
}

.table-card tbody tr:hover {
    background: #fafcff;
    transition: 0.15s;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .70rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-completed { background: #dcfce7; color: #166534; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-failed { background: #fee2e2; color: #991b1b; }

/* ============================================
   FILTERS
   ============================================ */

.filter-row {
    background: #f8fafc;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 4px;
}

#transactionFilterForm label {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

#transactionFilterForm .form-control {
    border-color: #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

#transactionFilterForm .form-control:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 .15rem rgba(37, 99, 235, .10);
}

.btn-clear-filters {
    border-radius: 40px;
    padding: 0.3rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    border-color: #e2e8f0;
    transition: 0.15s;
}

.btn-clear-filters:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.btn-apply-filters {
    border-radius: 40px;
    padding: 0.3rem 1.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: #1d4ed8;
    border: 0;
    color: #fff;
    transition: 0.15s;
}

.btn-apply-filters:hover {
    background: #1e40af;
    color: #fff;
}

.filter-count-badge {
    background: #e2e8f0;
    color: #475569;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   TRANSACTION DETAIL MODAL
   ============================================ */

.modal-transaction .modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-transaction .modal-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border: 0;
    padding: 20px 28px;
}

.modal-transaction .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.modal-transaction .modal-header .btn-close:hover {
    opacity: 1;
}

.modal-transaction .modal-title {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.modal-transaction .modal-body {
    padding: 28px;
    background: #fafcff;
}

.modal-transaction .detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.modal-transaction .detail-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f0f4f9;
}

.modal-transaction .detail-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.modal-transaction .detail-item .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.modal-transaction .detail-item .value.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 3px 14px;
}

.modal-transaction .detail-item.full-width {
    grid-column: 1 / -1;
}

.modal-transaction .modal-footer {
    background: #fff;
    border-top: 1px solid #f0f4f9;
    padding: 16px 28px;
}

.modal-transaction .modal-footer .btn {
    border-radius: 40px;
    padding: 0.4rem 1.4rem;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ============================================
   FOOTER
   ============================================ */

.footer-clean {
    padding: 1.2rem 2rem;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.03);
    color: #617b89;
    font-size: 0.85rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-green { color: var(--primary-green); }
.bg-soft-green { background: #eaf9f0; }
.gap-2 { gap: 0.5rem; }
.w-36 { width: 36px; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1055;
        overflow-y: auto;
        transition: left 0.25s ease;
    }

    .sidebar.sidebar-open {
        left: 0;
    }

    #content-wrapper {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1054;
    }

    .sidebar-overlay.active {
        display: block;
    }

    #wrapper {
        flex-direction: column;
    }

    .dashboard-header {
        padding: 22px;
    }

    .dashboard-header h1 {
        font-size: 1.35rem;
    }

    .modal-transaction .detail-grid {
        grid-template-columns: 1fr;
    }

    .filter-row .row > div {
        margin-bottom: 10px;
    }

    .page-content {
        padding: 1rem 1rem 0.5rem;
    }

    .topbar {
        padding: 0.6rem 1rem;
    }
}
/* ============================================
   PAGINATION
   ============================================ */

.pagination-wrapper .pagination {
    margin-bottom: 0;
    gap: 3px;
    flex-wrap: wrap;
}

.pagination-wrapper .page-link {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px !important;
    min-width: 30px;
    text-align: center;
    transition: all 0.15s;
}

.pagination-wrapper .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.pagination-wrapper .page-item.active .page-link {
    background: #04bb4a;
    border-color: #04bb4a;
    color: #fff;
    font-weight: 600;
}

.pagination-wrapper .page-item.disabled .page-link {
    color: #cbd5e1;
    background: #f8fafc;
    border-color: #e2e8f0;
    pointer-events: none;
}

@media (max-width: 991px) {
.stat-card .stat-value { font-size: 1.4rem; }
}

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

.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow: hidden;
    background: var(--sidebar-bg);
}

.auth-shell {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.30);
    padding: 2rem;
    backdrop-filter: blur(8px);
}

.auth-card--register {
    max-width: 500px;
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-card__logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: 42px;
    object-fit: contain;
    margin: 0 auto 0.9rem;
}

.auth-card__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--primary-green);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-card__title {
    margin: 0;
    color: #0f1720;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-form {
    margin-top: 1.5rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: #20313a;
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-input {
    height: 48px;
    border: 1px solid #d5dfe4;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: #12232b;
    background: #f9fbfc;
    box-shadow: inset 0 1px 1px rgba(15, 26, 31, 0.02);
}

.auth-input::placeholder {
    color: #8aa0ad;
}

.auth-input:focus {
    border-color: rgba(4, 187, 74, 0.55);
    box-shadow: 0 0 0 0.18rem rgba(4, 187, 74, 0.16);
}

.auth-password {
    position: relative;
}

.auth-password__input {
    padding-right: 3.1rem;
}

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border: 0;
    background: transparent;
    color: #6f8791;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-password__toggle:hover,
.auth-password__toggle:focus {
    color: var(--primary-dark);
    background: rgba(4, 187, 74, 0.08);
}

.auth-password__toggle i {
    font-size: 0.95rem;
}

.auth-form__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.25rem 0 1.4rem;
}

.auth-remember {
    min-height: 1.2rem;
    margin: 0;
    padding-left: 1.45rem;
}

.auth-remember .custom-control-label {
    color: #465a64;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-remember .custom-control-label::before,
.auth-remember .custom-control-label::after {
    top: 0.14rem;
}

.auth-remember .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--primary-green);
    background-color: var(--primary-green);
}

.auth-forgot {
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-forgot:hover {
    color: var(--primary-green);
    text-decoration: none;
}

.auth-button {
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(4, 187, 74, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(4, 187, 74, 0.25);
    filter: brightness(1.02);
}

.auth-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(4, 187, 74, 0.18);
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
    }

    .auth-card {
        padding: 1.35rem;
        border-radius: 20px;
    }

    .auth-form__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .auth-forgot {
        align-self: flex-start;
    }
}
