/* ============================================================
   Verse API — Main Stylesheet
   ============================================================ */

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a1d29 100%);
    color: #e2e8f0;
    min-height: 100vh
}

a {
    text-decoration: none;
    color: inherit
}

/* ── Layout ── */

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

.main-content {
    margin-left: 260px;
    padding: 25px;
    min-height: 100vh;
    flex: 1
}

/* ── Sidebar ── */

.sidebar {
    width: 260px;
    background: #111420;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 900;
    transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s;
    overflow: hidden
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 64px;
    min-height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    background: #111420;
    flex-shrink: 0
}

.sidebar-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(139, 92, 246, .3);
    border-radius: 8px;
    background: rgba(139, 92, 246, .1);
    color: #c4b5fd;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s
}

.sidebar-user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05)
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    font-size: 18px;
    flex-shrink: 0
}

.sidebar-menu {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 .5rem;
    min-height: 0
}

.menu-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: .9rem 1rem .3rem
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: .4rem 0
}

.sidebar-menu li {
    margin: .15rem 0
}

.sidebar-menu a {
    color: #8e95a9;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: .7rem 1rem;
    border-radius: 10px;
    transition: background .2s, color .2s;
    font-size: 14px;
    font-weight: 500
}

.sidebar-menu a i {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(139, 92, 246, .12);
    color: #c4b5fd
}

.sidebar-menu a.active {
    background: rgba(139, 92, 246, .18);
    color: #fff;
    font-weight: 600
}

.sidebar-footer {
    padding: 12px 1rem;
    border-top: 1px solid rgba(255, 255, 255, .06)
}

.balance-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #c4b5fd
}

/* ── Top Bar ── */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 12px;
    padding: 22px 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3)
}

.page-title h1 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px
}

.page-title h1 i {
    color: #8b5cf6
}

.page-title p {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px
}

/* ── Stat Cards ── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px
}

.stat-card {
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    transition: transform .3s, box-shadow .3s, border-color .3s;
    position: relative;
    overflow: hidden;
    animation: fadeInUp .4s ease-out forwards
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px
}

.stat-card.primary::before {
    background: linear-gradient(90deg, #8b5cf6, #6366f1)
}

.stat-card.success::before {
    background: linear-gradient(90deg, #10b981, #059669)
}

.stat-card.warning::before {
    background: linear-gradient(90deg, #f59e0b, #d97706)
}

.stat-card.danger::before {
    background: linear-gradient(90deg, #ef4444, #dc2626)
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(139, 92, 246, .2);
    border-color: rgba(139, 92, 246, .4)
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px
}

.stat-title {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .7px
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(139, 92, 246, .12);
    color: #8b5cf6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px
}

.stat-card.success .stat-icon {
    background: rgba(16, 185, 129, .12);
    color: #10b981
}

.stat-card.warning .stat-icon {
    background: rgba(245, 158, 11, .12);
    color: #f59e0b
}

.stat-card.danger .stat-icon {
    background: rgba(239, 68, 68, .12);
    color: #ef4444
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    word-break: break-all
}

.stat-change {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px
}

/* ── Data Card ── */

.data-card {
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    margin-bottom: 24px;
    overflow: hidden
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(139, 92, 246, .15)
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #c4b5fd;
    display: flex;
    align-items: center;
    gap: 8px
}

.card-title i {
    color: #8b5cf6
}

.card-body {
    padding: 24px
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    font-family: inherit;
    border: none;
    text-decoration: none
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px
}

.btn-primary {
    padding: 10px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-1px)
}

.btn-success {
    padding: 10px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff
}

.btn-danger {
    padding: 7px 14px;
    font-size: 13px;
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #f87171
}

.btn-outline {
    padding: 9px 18px;
    font-size: 14px;
    background: transparent;
    border: 1px solid rgba(139, 92, 246, .4);
    color: #c4b5fd
}

.btn-outline:hover {
    background: rgba(139, 92, 246, .12);
    color: #fff;
    border-color: rgba(139, 92, 246, .7)
}

.btn-warning {
    padding: 7px 14px;
    font-size: 13px;
    background: rgba(245, 158, 11, .15);
    border: 1px solid rgba(245, 158, 11, .3);
    color: #fbbf24
}

/* ── Table ── */

.table-responsive {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .7px;
    border-bottom: 1px solid rgba(139, 92, 246, .15)
}

tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    transition: background .2s
}

tbody tr:hover {
    background: rgba(139, 92, 246, .05)
}

tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: #cbd5e1
}

/* ── Badges ── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600
}

.badge-success {
    background: rgba(16, 185, 129, .15);
    color: #10b981
}

.badge-danger {
    background: rgba(239, 68, 68, .15);
    color: #ef4444
}

.badge-warning {
    background: rgba(245, 158, 11, .15);
    color: #f59e0b
}

.badge-info {
    background: rgba(59, 130, 246, .15);
    color: #60a5fa
}

.badge-secondary {
    background: rgba(100, 116, 139, .15);
    color: #94a3b8
}

/* ── Forms ── */

.form-group {
    margin-bottom: 20px
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    background: rgba(19, 22, 31, .8);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s
}

.form-control:focus {
    outline: none;
    border-color: rgba(139, 92, 246, .6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .1)
}

.form-control[readonly] {
    opacity: .6;
    cursor: not-allowed
}

select.form-control {
    cursor: pointer
}

.form-help {
    font-size: 11px;
    color: #475569;
    margin-top: 5px;
    display: block
}

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

/* ── Input Group ── */

.input-group {
    display: flex;
    gap: 0
}

.input-group .form-control {
    border-radius: 8px 0 0 8px
}

.input-group .btn {
    border-radius: 0 8px 8px 0
}

/* ── Alerts ── */

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    margin-bottom: 16px
}

.alert-info {
    background: rgba(139, 92, 246, .08);
    border: 1px solid rgba(139, 92, 246, .25);
    color: #94a3b8
}

.alert-info i {
    color: #8b5cf6;
    font-size: 16px;
    flex-shrink: 0
}

.alert-success {
    background: rgba(16, 185, 129, .08);
    border: 1px solid rgba(16, 185, 129, .25);
    color: #10b981
}

.alert-danger {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .25);
    color: #f87171
}

.alert-warning {
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .25);
    color: #fbbf24
}

/* ── API cred display ── */

.cred-grid {
    display: grid;
    gap: 20px
}

.cred-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px
}

.cred-value {
    display: inline-block;
    padding: 10px 16px;
    background: rgba(19, 22, 31, .8);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 8px;
    color: #c4b5fd;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all
}

/* ── Mobile Header ── */

.mobile-app-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border-bottom: 1px solid rgba(139, 92, 246, .2);
    padding: 14px 20px;
    z-index: 1000;
    align-items: center;
    justify-content: space-between
}

.mobile-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b5cf6;
    font-size: 16px;
    cursor: pointer
}

/* ── Mobile Bottom Nav ── */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border-top: 1px solid rgba(139, 92, 246, .2);
    padding: 10px 0;
    z-index: 1000;
    justify-content: space-around
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 10px;
    transition: color .3s
}

.mobile-nav-item i {
    font-size: 20px
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: #8b5cf6
}

/* ── Login Page ── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(145deg, #1a1d29, #13161f);
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5)
}

.login-logo {
    text-align: center;
    margin-bottom: 30px
}

.login-logo i {
    font-size: 40px;
    color: #8b5cf6
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-top: 10px
}

.login-logo p {
    font-size: 13px;
    color: #64748b;
    margin-top: 5px
}

/* ── Toast ── */

.vs-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight .3s ease, fadeOut .4s 3s forwards;
    background: #1a1d29;
    border: 1px solid rgba(139, 92, 246, .3);
    color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4)
}

.vs-toast.success {
    border-color: rgba(16, 185, 129, .4);
    color: #10b981
}

.vs-toast.error {
    border-color: rgba(239, 68, 68, .4);
    color: #f87171
}

.vs-toast.warning {
    border-color: rgba(245, 158, 11, .4);
    color: #fbbf24
}

/* ── Pagination ── */

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin-top: 20px
}

.page-btn {
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .2);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s
}

.page-btn:hover,
.page-btn.active {
    background: rgba(139, 92, 246, .3);
    border-color: rgba(139, 92, 246, .5);
    color: #fff
}

.page-btn.disabled {
    opacity: .4;
    cursor: not-allowed
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
    width: 6px
}

::-webkit-scrollbar-track {
    background: #1a1d29
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b5cf6, #6366f1);
    border-radius: 4px
}

/* ── Animations ── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px)
    }
    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes fadeOut {
    from {
        opacity: 1
    }
    to {
        opacity: 0
    }
}

/* ── Responsive ── */

@media(max-width:1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(max-width:1024px) {
    .main-content {
        margin-left: 0;
        padding: 80px 16px 90px
    }
    .top-bar {
        display: none
    }
    .mobile-app-header {
        display: flex
    }
    .mobile-bottom-nav {
        display: flex
    }
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none
    }
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 60px rgba(0, 0, 0, .8)
    }
    .sidebar-close-btn {
        display: flex
    }
}

@media(max-width:600px) {
    .stats-grid {
        grid-template-columns: 1fr
    }
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px
    }
    .form-grid {
        grid-template-columns: 1fr
    }
}

/* ═══════════════════════════════════
   ADMIN PANEL EXTRA STYLES
═══════════════════════════════════ */

.admin-sidebar .sidebar-menu a.active {
    background: rgba(16, 185, 129, .18);
    color: #10b981
}

.admin-sidebar .sidebar-menu a:hover {
    background: rgba(16, 185, 129, .1);
    color: #34d399
}

.admin-sidebar .balance-badge {
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .25);
    color: #34d399
}

.admin-topbar-badge {
    background: rgba(16, 185, 129, .15);
    border: 1px solid rgba(16, 185, 129, .3);
    color: #10b981;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600
}

/* Filter Bar */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px
}

.filter-bar .form-control {
    width: auto;
    min-width: 150px;
    padding: 8px 12px;
    font-size: 13px
}