/* Layout variables */
        :root {
            --sidebar-width: 260px;
        }

        .dash-layout {
            display: flex;
            min-height: 100vh;
        }

        .sidebar {
            width: var(--sidebar-width);
            background: #0b0b15;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            display: flex;
            flex-direction: column;
            border-right: 1px solid rgba(255, 255, 255, 0.05);
            z-index: 1000;
        }

        .sidebar-logo {
            padding: 24px;
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
        }

        .sidebar-logo img {
            width: 32px;
            height: 32px;
            border-radius: 8px;
        }

        .sidebar-logo span {
            font-size: 18px;
            font-weight: 800;
            color: #fff;
            letter-spacing: -0.5px;
        }

        .sidebar-nav {
            padding: 10px 16px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .sidebar-nav a {
            padding: 12px 16px;
            border-radius: 12px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s;
        }

        .sidebar-nav a:hover {
            background: rgba(255, 255, 255, 0.03);
            color: #fff;
        }

        .sidebar-nav a.active {
            background: rgba(139, 92, 246, 0.15);
            color: #fff;
            border-left: 3px solid #8b5cf6;
        }

        .sidebar-nav a svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
        }

        .dash-main {
            flex: 1;
            margin-left: var(--sidebar-width);
            position: relative;
        }

        .dash-wrap {
            position: relative;
            z-index: 1;
            max-width: 1000px;
            margin: 0 auto;
            padding: 40px 32px 100px;
        }

        .dash-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 40px;
            flex-wrap: wrap;
            gap: 16px;
        }

        .dash-header h1 {
            font-size: 26px;
            font-weight: 800;
        }

        .dash-header h1 span {
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .dash-user {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .dash-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--accent-gradient-btn);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 700;
            color: #fff;
        }

        .dash-email {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .btn-logout {
            padding: 8px 18px;
            border: 1px solid rgba(248, 113, 113, 0.2);
            background: rgba(248, 113, 113, 0.06);
            color: var(--red);
            border-radius: 8px;
            font-family: 'Inter', sans-serif;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-logout:hover {
            background: rgba(248, 113, 113, 0.15);
        }

        /* Stats */
        .dash-stats {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 32px;
        }

        .dash-stat {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: var(--radius-md);
            padding: 20px;
            transition: border-color 0.2s, transform 0.2s;
        }

        .dash-stat:hover {
            border-color: rgba(124, 58, 237, 0.2);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        }

        .dash-stat-label {
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
            font-weight: 600;
        }

        .dash-stat-value {
            font-size: 26px;
            font-weight: 700;
        }

        .dash-stat-value.purple {
            color: var(--accent-2);
        }

        .dash-stat-value.green {
            color: var(--green);
        }

        .dash-stat-value.cyan {
            color: var(--cyan);
        }

        /* Sections */
        .dash-section {
            margin-bottom: 28px;
        }

        .dash-section-title {
            font-size: 17px;
            font-weight: 700;
            margin-bottom: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .dash-section-title svg {
            width: 18px;
            height: 18px;
            stroke: var(--accent-2);
            fill: none;
            stroke-width: 2;
        }

        /* Code cards */
        .code-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .code-item {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            transition: border-color 0.2s;
        }

        .code-item:hover {
            border-color: var(--border-hover);
        }

        .code-item-left {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .code-item-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
        }

        .code-item-icon.unused {
            background: rgba(34, 211, 238, 0.08);
            border: 1px solid rgba(34, 211, 238, 0.15);
        }

        .code-item-icon.used {
            background: rgba(100, 100, 138, 0.08);
            border: 1px solid rgba(100, 100, 138, 0.15);
        }

        .code-item-code {
            font-family: 'Courier New', monospace;
            font-weight: 700;
            font-size: 15px;
            color: var(--accent-2);
            letter-spacing: 1px;
        }

        .code-item-value {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .code-item-right {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .code-badge {
            padding: 4px 12px;
            border-radius: 50px;
            font-size: 11px;
            font-weight: 600;
        }

        .code-badge.unused {
            background: rgba(34, 211, 238, 0.08);
            color: var(--cyan);
        }

        .code-badge.used {
            background: rgba(100, 100, 138, 0.08);
            color: var(--text-muted);
        }

        .empty-state {
            text-align: center;
            padding: 48px 24px;
            color: var(--text-muted);
        }

        .empty-state svg {
            width: 48px;
            height: 48px;
            stroke: var(--text-muted);
            fill: none;
            stroke-width: 1.5;
            margin-bottom: 16px;
            opacity: 0.4;
        }

        .empty-state p {
            font-size: 15px;
            margin-bottom: 16px;
        }

        .btn-copy-ref {
            padding: 6px 14px;
            background: rgba(124, 58, 237, 0.12);
            border: 1px solid rgba(124, 58, 237, 0.3);
            color: var(--accent-2);
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
        }

        .btn-copy-ref:hover {
            background: rgba(124, 58, 237, 0.2);
        }

        .ref-block {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            padding: 16px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
        }

        .ref-code {
            font-family: 'Courier New', monospace;
            font-size: 20px;
            font-weight: 800;
            letter-spacing: 2px;
            color: var(--accent-2);
        }

        .ref-hint {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .badge-expiry {
            padding: 3px 8px;
            border-radius: 50px;
            font-size: 10px;
            font-weight: 600;
            background: rgba(251, 191, 36, 0.1);
            color: var(--amber);
            border: 1px solid rgba(251, 191, 36, 0.25);
        }

        .btn-buy-link {
            padding: 10px 24px;
            background: var(--accent-gradient-btn);
            color: #fff;
            border-radius: var(--radius-sm);
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-buy-link:hover {
            box-shadow: 0 4px 16px var(--accent-glow);
            transform: translateY(-1px);
        }

        @media(max-width:768px) {
            .dash-header {
                flex-direction: column;
                align-items: flex-start;
            }

            .dash-stats {
                grid-template-columns: repeat(2, 1fr);
            }

            .code-item {
                flex-direction: column;
                align-items: flex-start;
            }

            .code-item-right {
                width: 100%;
                justify-content: flex-end;
            }

            .order-table {
                font-size: 12px;
            }

            .order-table th,
            .order-table td {
                padding: 8px 10px;
            }
        }

        /* Order history table */
        .order-table-wrap {
            overflow-x: auto;
            border-radius: var(--radius-md);
        }

        .order-table {
            width: 100%;
            border-collapse: collapse;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            overflow: hidden;
            font-size: 13px;
        }

        .order-table th {
            text-align: left;
            padding: 12px 14px;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-muted);
            background: rgba(255, 255, 255, 0.02);
            border-bottom: 1px solid var(--border);
        }

        .order-table td {
            padding: 11px 14px;
            color: var(--text-secondary);
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            vertical-align: middle;
        }

        .order-table tr:last-child td {
            border-bottom: none;
        }

        .order-table tr:hover td {
            background: rgba(124, 58, 237, 0.03);
        }

        .o-code {
            font-family: 'Courier New', monospace;
            font-size: 12px;
            color: var(--accent-2);
            font-weight: 700;
        }

        .o-badge {
            display: inline-block;
            padding: 2px 9px;
            border-radius: 50px;
            font-size: 11px;
            font-weight: 600;
        }

        .o-badge.paid {
            background: rgba(52, 211, 153, 0.1);
            color: var(--green);
        }

        .o-badge.pending {
            background: rgba(251, 191, 36, 0.1);
            color: var(--amber);
        }

        .o-badge.cancelled {
            background: rgba(248, 113, 113, 0.1);
            color: var(--red);
        }

        .o-badge.expired {
            background: rgba(100, 100, 138, 0.1);
            color: var(--text-muted);
        }

        /* Custom Confirm Modal */
        .confirm-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .confirm-modal.active {
            opacity: 1;
            visibility: visible;
        }

        .confirm-box {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 30px;
            max-width: 400px;
            width: 90%;
            text-align: center;
            transform: translateY(20px) scale(0.95);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .confirm-modal.active .confirm-box {
            transform: translateY(0) scale(1);
        }

        .confirm-icon {
            width: 60px;
            height: 60px;
            background: rgba(248, 113, 113, 0.1);
            color: var(--red);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
        }

        .confirm-icon svg {
            width: 30px;
            height: 30px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
        }

        .confirm-title {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .confirm-text {
            color: var(--text-muted);
            font-size: 14px;
            margin-bottom: 24px;
            line-height: 1.5;
        }

        .confirm-actions {
            display: flex;
            gap: 12px;
        }

        .btn-cancel-modal {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: transparent;
            color: var(--text-primary);
            cursor: pointer;
            font-weight: 600;
            transition: 0.2s;
        }

        .btn-cancel-modal:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .btn-confirm-modal {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            border: none;
            background: var(--red);
            color: white;
            cursor: pointer;
            font-weight: 600;
            transition: 0.2s;
        }

        .btn-confirm-modal:hover {
            background: #ef4444;
        }

        /* Toast */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(16px);
            color: #fff;
            padding: 14px 20px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

        @keyframes toastIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }

            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        @keyframes toastOut {
            from {
                transform: translateX(0);
                opacity: 1;
            }

            to {
                transform: translateX(100%);
                opacity: 0;
            }
        }

        .dep-preset {
            padding: 10px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .dep-preset:hover,
        .dep-preset.active {
            background: rgba(124, 58, 237, 0.2);
            border-color: rgba(124, 58, 237, 0.4);
            color: var(--accent-2);
        }

        #depositAmountInput::-webkit-outer-spin-button,
        #depositAmountInput::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        #depositAmountInput {
            -moz-appearance: textfield;
            appearance: textfield;
        }
