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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: #f4f6f9;
    color: #1f2937;
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

/* ===== Layout ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 64px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px;
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.18);
}

.logo {
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    min-width: 0;
}

.user-info a {
    color: #fecaca;
    text-decoration: none;
    font-weight: 700;
}

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
}

.layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 64px);
}

.sidebar {
    position: sticky;
    top: 64px;
    width: 245px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: #1f2937;
    padding: 14px 10px;
    flex-shrink: 0;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin-bottom: 5px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-content {
    flex: 1;
    min-width: 0;
    width: min(100%, 1120px);
    margin: 24px auto;
    padding: 26px;
    background: var(--surface);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.footer {
    background: var(--surface);
    border-top: 1px solid #e5e7eb;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* ===== Typography ===== */
.page-title,
.orders-page-title,
.main-content > h2 {
    color: var(--text);
    font-size: 23px;
    font-weight: 800;
    margin-bottom: 18px;
}

.section-title,
.main-content > h3 {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    margin: 28px 0 14px;
}

.welcome-text {
    margin-bottom: 24px;
    color: #4b5563;
    font-size: 15px;
}

/* ===== Buttons ===== */
.btn-details,
.orders-details-btn,
.btn-primary,
.btn-secondary,
.contact-admin-btn,
button[type="submit"],
.checkout-action,
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 9px 15px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn-details,
.orders-details-btn,
.purchase-form .btn-details {
    width: 100%;
}

.btn-details:hover,
.orders-details-btn:hover,
.btn-primary:hover,
.contact-admin-btn:hover,
.checkout-action:hover,
.copy-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.22);
}

.btn-secondary {
    background: #4b5563;
}

.btn-secondary:hover {
    background: #374151;
}

.btn-danger {
    background: #dc2626 !important;
    color: #fff !important;
}

.btn-disabled,
button:disabled {
    background: #d1d5db !important;
    color: #6b7280 !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.copy-btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
}

/* ===== Forms ===== */
form {
    max-width: 100%;
}

label {
    display: block;
    margin: 12px 0 6px;
    color: #374151;
    font-size: 14px;
    font-weight: 800;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
#searchBox {
    width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: var(--surface-solid);
    color: var(--text);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.purchase-form {
    margin-top: auto;
}

.inline-form {
    margin: 0;
}

.readonly-field {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 12px;
    color: #374151;
}

.readonly-field small {
    display: block;
    color: #6b7280;
    margin-top: 4px;
}

/* ===== Cards & Messages ===== */
.number-card,
.orders-card,
.dashboard-card,
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.number-card:hover,
.orders-card:hover,
.dashboard-card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.empty-message,
.success-message,
.error-message,
.canceled-message {
    padding: 13px 15px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 800;
}

.empty-message {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.success-message {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    animation: fadeInMsg 0.3s ease;
}

.error-message,
.canceled-message {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.canceled-message {
    text-align: center;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Numbers Page ===== */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.number-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.service-icon {
    object-fit: contain;
    flex-shrink: 0;
}

.service-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto;
}

.number-value {
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    overflow-wrap: anywhere;
}

.number-info {
    display: grid;
    gap: 7px;
    color: #4b5563;
    font-size: 14px;
}

.number-info span {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.purchase-overlay,
.checkout-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.7);
    z-index: 999999;
}

/* Keep generic hiding before overlay-specific rules; overlay components set display later. */
.is-hidden {
    display: none;
}

.purchase-overlay-box,
.checkout-modal-box {
    width: min(100%, 340px);
    background: var(--surface);
    border-radius: 14px;
    padding: 26px;
    text-align: center;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
}

.purchase-overlay-box {
    font-size: 20px;
    font-weight: 800;
}

/* ===== Dashboard ===== */
.dashboard-stats,
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin: 24px 0 32px;
}

.dashboard-card,
.stat-card {
    text-align: center;
}

.dashboard-card .number-value,
.dashboard-card .value,
.stat-card strong {
    display: block;
    color: #2563eb;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 4px;
}

.dashboard-card span,
.stat-card span {
    color: #6b7280;
    font-size: 14px;
}

.wallet-display {
    display: inline-flex;
    align-items: center;
    margin: 8px 0 0;
    padding: 6px 11px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.order-item:last-child {
    border-bottom: 0;
}

/* ===== Status ===== */
.order-status,
.orders-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 900;
}

/* ===== Orders ===== */
.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
}

.orders-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

.orders-label {
    color: #6b7280;
}

.orders-value {
    color: var(--text);
    font-weight: 900;
}

.orders-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* ===== Popups ===== */
.popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.68);
    z-index: 9999;
}

/* Must stay after overlay display rules so hidden overlays do not intercept clicks. */
.purchase-overlay.is-hidden,
.popup-overlay.is-hidden {
    display: none;
}

.popup-box {
    width: min(100%, 380px);
    max-height: min(88vh, 680px);
    overflow-y: auto;
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    text-align: right;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.popup-box h3 {
    margin-bottom: 14px;
    color: var(--text);
}

.popup-box p {
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.popup-box form {
    margin: 14px 0 10px;
}

/* ===== Order Details ===== */
.order-details-content {
    width: min(100%, 680px);
}

.info-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 11px;
    border-radius: 12px;
    margin: 10px 0;
    overflow-wrap: anywhere;
}

.code-box {
    background: #ecfdf5;
    border: 2px dashed #10b981;
    padding: 16px;
    text-align: center;
    font-size: 24px;
    border-radius: 14px;
    margin-top: 12px;
    color: #065f46;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.status-note {
    color: #dc2626;
    font-weight: 900;
}

/* ===== Notifications ===== */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-title {
    color: var(--text);
    font-weight: 900;
    margin-bottom: 6px;
}

.notification-message {
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.notification-date {
    color: #6b7280;
    font-size: 13px;
}

/* ===== Profile & Deposit ===== */
.profile-info-card,
.profile-edit-card,
.deposit-card {
    margin-bottom: 20px;
}

.profile-info-card h3,
.profile-edit-card h3 {
    margin-bottom: 12px;
    color: var(--text);
}

.profile-info-card p,
.deposit-card p {
    margin-bottom: 10px;
}

.balance-box,
.current-balance {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
}

.profile-edit-card hr,
.deposit-card hr,
.main-content hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 22px 0;
}

.deposit-note {
    color: #6b7280;
    font-size: 14px;
}

/* ===== Checkout Standalone Messages ===== */
.checkout-page {
    min-height: 100vh;
    background: #f4f6f9;
}

.checkout-action {
    width: 100%;
    margin-top: 15px;
}

.checkout-back {
    margin-top: 10px;
    background: #4b5563;
}

.checkout-back:hover {
    background: #374151;
}

.checkout-error-text {
    margin-top: 10px;
    color: #4b5563;
}

/* ===== Scroll To Top ===== */
.scroll-top-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1100;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .main-content {
        margin: 18px;
        width: calc(100% - 36px);
    }

    .numbers-grid,
    .orders-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .user-info {
        font-size: 13px;
        justify-content: flex-end;
        text-align: left;
        max-width: 42%;
        overflow-wrap: anywhere;
    }

    .main-content {
        width: calc(100% - 24px);
        margin: 12px;
        padding: 18px;
        border-radius: 12px;
    }

    .page-title,
    .orders-page-title,
    .main-content > h2 {
        font-size: 20px;
    }

    .dashboard-stats,
    .profile-stats,
    .numbers-grid,
    .orders-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .orders-card-row,
    .order-item,
    .info-box,
    .orders-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .popup-box,
    .checkout-modal-box {
        width: 100%;
        padding: 20px;
    }

    .code-box {
        font-size: 20px;
    }
}

@media (max-width: 420px) {
    .header {
        gap: 8px;
    }

    .user-info {
        max-width: 48%;
        gap: 6px;
    }

    .number-card,
    .orders-card,
    .dashboard-card,
    .stat-card,
    .notification-item,
    .deposit-card,
    .profile-info-card,
    .profile-edit-card {
        padding: 14px;
    }

    .btn-details,
    .orders-details-btn,
    .btn-primary,
    .btn-secondary,
    .contact-admin-btn,
    button[type="submit"],
    .checkout-action {
        width: 100%;
    }

    .scroll-top-btn {
        left: 14px;
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== Hero & SEO Sections ===== */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.hero-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 15px;
}

.hero-title {
    font-size: 36px;
    color: var(--text);
    margin-bottom: 15px;
}

.hero-description {
    max-width: 700px;
    margin: auto;
    color: #6b7280;
    line-height: 2;
    font-size: 19px;
}

.hero-features {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-features span {
    background: #eff6ff;
    color: #2563eb;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
}

.hero-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
}

.hero-btn:hover {
    background: #1d4ed8;
}

@media(max-width:768px){

    .hero-title {
        font-size: 28px;
    }

    .hero-description {
        font-weight: 500;
    }

    .hero-logo {
        width: 90px;
        height: 90px;
    }
}

.page-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
    flex-wrap:wrap;
    gap:15px;
}

.btn-back{
    background:#2563eb;
    color:#fff;
    padding:10px 18px;
    border-radius:8px;
    text-decoration:none;
    font-weight:bold;
    transition:.2s;
}

.btn-back:hover{
    background:#1d4ed8;
}

/* ===== Modern Base Refresh ===== */
body {
    background:
        radial-gradient(circle at top right, rgba(42, 171, 238, 0.16), transparent 30%),
        radial-gradient(circle at 12% 0, rgba(99, 91, 255, 0.14), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg-page) 42%, #f7f8fb 100%);
    color: var(--text-main);
    font-family: Tahoma, Arial, sans-serif;
}

a,
button,
input,
select,
textarea,
.number-card,
.orders-card,
.dashboard-card,
.stat-card,
.notification-item,
.deposit-card,
.profile-info-card,
.profile-edit-card,
.popup-box,
.checkout-modal-box {
    transition:
        background-color var(--ease),
        border-color var(--ease),
        box-shadow var(--ease),
        color var(--ease),
        opacity var(--ease),
        transform var(--ease);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(42, 171, 238, 0.32);
    outline-offset: 3px;
}

/* ===== Modern Header & Sidebar ===== */
.header {
    min-height: 68px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-main);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.logo {
    color: var(--github);
    font-weight: 900;
    letter-spacing: 0;
}

.user-info {
    color: var(--text-muted);
}

.user-info a {
    color: var(--primary);
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
}

.user-info a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--telegram));
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.menu-toggle {
    background: rgba(37, 99, 235, 0.09);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 12px;
}

.menu-toggle:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.layout {
    background: transparent;
}

.sidebar {
    top: 68px;
    background: linear-gradient(180deg, #111827 0%, #172033 58%, #0f172a 100%);
    border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 14px 0 40px rgba(15, 23, 42, 0.1);
}

.sidebar a {
    color: rgba(241, 245, 249, 0.82);
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 800;
}

/* ===== Modern Main Shell ===== */
.main-content {
    width: min(100%, 1180px);
    margin: 26px auto;
    padding: 30px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.footer {
    background: rgba(255, 255, 255, 0.88);
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
}

/* ===== Modern Typography ===== */
.page-title,
.orders-page-title,
.main-content > h2,
.section-title,
.main-content > h3 {
    color: var(--text-main);
    letter-spacing: 0;
}

.page-title,
.orders-page-title,
.main-content > h2 {
    font-size: 26px;
}

.welcome-text,
.deposit-note,
.checkout-error-text {
    color: var(--text-muted);
}

/* ===== Modern Buttons ===== */
.btn-details,
.orders-details-btn,
.btn-primary,
.contact-admin-btn,
button[type="submit"],
.checkout-action,
.copy-btn,
.hero-btn,
.btn-back {
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--telegram));
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.btn-details:hover,
.orders-details-btn:hover,
.btn-primary:hover,
.contact-admin-btn:hover,
button[type="submit"]:hover,
.checkout-action:hover,
.copy-btn:hover,
.hero-btn:hover,
.btn-back:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--stripe));
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
}

.btn-secondary,
.checkout-back {
    background: #334155;
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(51, 65, 85, 0.18);
}

.btn-secondary:hover,
.checkout-back:hover {
    background: var(--github);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f97316) !important;
    box-shadow: 0 12px 26px rgba(239, 68, 68, 0.2) !important;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark), #ea580c) !important;
    transform: translateY(-2px);
}

.btn-disabled,
button:disabled {
    background: #e2e8f0 !important;
    color: var(--text-soft) !important;
    border: 1px solid #cbd5e1 !important;
}

/* ===== Modern Forms ===== */
label {
    color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
#searchBox {
    min-height: 48px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    color: var(--text-main);
    box-shadow: var(--shadow-xs);
}

input:hover,
#searchBox:hover {
    border-color: rgba(42, 171, 238, 0.42);
}

input:focus,
#searchBox:focus {
    border-color: var(--telegram);
    box-shadow: 0 0 0 5px rgba(42, 171, 238, 0.14);
}

.search-input {
    margin-bottom: 24px;
}

.readonly-field {
    background: var(--surface-muted);
    border-color: var(--border-soft);
    border-radius: 16px;
    color: var(--text-main);
}

.readonly-field small {
    color: var(--text-muted);
}

/* ===== Modern Cards & Feedback ===== */
.dashboard-card,
.number-card,
.orders-card,
.deposit-card,
.profile-info-card,
.profile-edit-card,
.stat-card,
.notification-item,
.last-orders {
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.number-card,
.orders-card,
.dashboard-card,
.stat-card,
.notification-item,
.deposit-card,
.profile-info-card,
.profile-edit-card {
    padding: 20px;
}

.number-card:hover,
.orders-card:hover,
.dashboard-card:hover,
.stat-card:hover,
.notification-item:hover {
    transform: translateY(-4px);
    border-color: rgba(42, 171, 238, 0.22);
    box-shadow: var(--shadow-md);
}

.empty-message,
.success-message,
.error-message,
.canceled-message {
    border-radius: 16px;
    box-shadow: var(--shadow-xs);
}

/* ===== Modern Numbers Page ===== */
.numbers-grid,
.orders-list {
    gap: 20px;
}

.number-card {
    position: relative;
    overflow: hidden;
}

.number-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.08), transparent 34%);
    opacity: 0;
    transition: opacity var(--ease);
}

.number-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 50px;
    height: 50px;
    padding: 7px;
    background: var(--surface-solid);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.number-value {
    color: var(--text-main);
    font-size: 17px;
}

.number-info {
    color: var(--text-muted);
}

.number-info span {
    justify-content: center;
}

.number-info h2 {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
}

/* ===== Modern Overlays & Popups ===== */
.purchase-overlay,
.checkout-modal,
.popup-overlay {
    background:
        radial-gradient(circle at top, rgba(42, 171, 238, 0.18), transparent 36%),
        rgba(15, 23, 42, 0.66);
    backdrop-filter: blur(10px);
}

.purchase-overlay-box,
.checkout-modal-box,
.popup-box {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.popup-box h3 {
    color: var(--text-main);
}

.popup-box p {
    color: var(--text-muted);
}

/* ===== Modern Dashboard & Stats ===== */
.dashboard-stats,
.profile-stats {
    gap: 20px;
}

.dashboard-card .number-value,
.dashboard-card .value,
.stat-card strong {
    color: var(--primary);
    font-size: 30px;
}

.dashboard-card span,
.stat-card span,
.orders-label {
    color: var(--text-muted);
}

.wallet-display,
.balance-box,
.current-balance {
    background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
    color: var(--success-dark);
    border: 1px solid rgba(16, 185, 129, 0.18);
    box-shadow: var(--shadow-xs);
}

.last-orders {
    padding: 12px 20px;
}

.order-item {
    border-bottom-color: var(--border-soft);
}

/* ===== Modern Status Badges ===== */
.order-status,
.orders-status {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--border-soft);
}

/* ===== Modern Orders & Details ===== */
.orders-card-row {
    color: var(--text-main);
}

.orders-value {
    color: var(--text-main);
}

.info-box {
    background: var(--surface-muted);
    border-color: var(--border-soft);
    border-radius: 16px;
}

.code-box {
    background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
    border-color: var(--success);
    color: #065f46;
    border-radius: 18px;
    box-shadow: var(--shadow-xs);
}

.status-note {
    color: var(--danger-dark);
}

/* ===== Modern Notifications & Profile ===== */
.notification-title,
.notification-message,
.profile-info-card h3,
.profile-edit-card h3 {
    color: var(--text-main);
}

.notification-date,
.profile-info-card p,
.deposit-card p {
    color: var(--text-muted);
}

.profile-edit-card hr,
.deposit-card hr,
.main-content hr {
    border-top-color: var(--border-soft);
}

/* ===== Modern Checkout & Utility ===== */
.checkout-page {
    background:
        radial-gradient(circle at top right, rgba(99, 91, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #f8fbff, #eef4ff);
}

.scroll-top-btn {
    background: linear-gradient(135deg, var(--primary), var(--stripe));
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

.scroll-top-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--telegram));
    transform: translateY(-2px);
}

/* ===== Modern Hero & SEO Sections ===== */
.hero-section {
    position: relative;
    overflow: hidden;
    padding: 46px 24px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 249, 255, 0.92)),
        radial-gradient(circle at top right, rgba(42, 171, 238, 0.24), transparent 34%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 28px;
    box-shadow: var(--shadow-md);
}

.hero-section::after {
    content: "";
    position: absolute;
    inset-inline: 12%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 91, 255, 0.5), transparent);
}

.hero-logo {
    width: 116px;
    height: 116px;
    padding: 10px;
    background: var(--surface-solid);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
}

.hero-title {
    color: var(--text-main);
    font-size: 38px;
    font-weight: 900;
}

.hero-description {
    color: var(--text-muted);
    font-size: 18px;
}

.hero-features span {
    background: rgba(255, 255, 255, 0.78);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: var(--shadow-xs);
}

.hero-features span:hover {
    transform: translateY(-2px);
    background: var(--surface-solid);
    box-shadow: var(--shadow-sm);
}

.page-header {
    padding-bottom: 6px;
}

/* ===== Modern Responsive Polish ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
        border-radius: 20px;
    }

    .hero-section {
        padding: 34px 18px;
        border-radius: 22px;
    }

    .hero-title {
        font-size: 29px;
    }

    .hero-description {
        font-size: 16px;
    }
}

@media (max-width: 420px) {
    .main-content {
        padding: 16px;
        border-radius: 18px;
    }

    .service-icon {
        width: 46px;
        height: 46px;
    }

    .hero-logo {
        width: 92px;
        height: 92px;
    }
}

/* ===== Mobile Sidebar Overlay Fix ===== */
@media (max-width: 768px) {
    .layout {
        display: block;
        min-height: calc(100vh - 60px);
    }

    .sidebar a {
        min-height: 46px;
        margin-bottom: 8px;
        padding: 11px 14px;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        color: rgba(248, 250, 252, 0.88);
        box-shadow: none;
    }

    .sidebar a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
        border-color: rgba(42, 171, 238, 0.38);
        transform: translateX(-3px);
        box-shadow: inset 3px 0 0 var(--telegram);
    }

    .main-content {
        transform: none;
    }
}

/* ===== Sidebar Visual Refresh With Original Mobile Behavior ===== */
@media (max-width: 768px) {
    .sidebar {
        position: sticky;
        top: 60px;
        right: auto;
        bottom: auto;
        z-index: 1000;
        width: 100%;
        max-height: 0;
        height: auto;
        padding: 0 10px;
        overflow: hidden;
        visibility: visible;
        transform: none;
        will-change: auto;
        border-radius: 0;
        border-inline-end: 0;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
        transition: max-height 0.25s ease, padding 0.25s ease, box-shadow 0.25s ease;
    }

    .sidebar a {
        min-height: 44px;
        margin-bottom: 8px;
        padding: 11px 14px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.04);
        box-shadow: none;
    }

    .sidebar a:hover {
        transform: translateX(-2px);
    }

}

/* ===== Sidebar Premium Visual Pass ===== */
.sidebar {
    background:
        linear-gradient(180deg, rgba(9, 14, 27, 0.98) 0%, rgba(15, 23, 42, 0.98) 46%, rgba(17, 24, 39, 0.98) 100%),
        #0f172a;
    border-inline-end: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.1);
}

.sidebar a {
    position: relative;
    isolation: isolate;
    min-height: 46px;
    margin-bottom: 8px;
    padding: 11px 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    color: rgba(248, 250, 252, 0.86);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.12);
    overflow: hidden;
}

.sidebar a::before {
    content: "";
    position: absolute;
    inset-block: 10px;
    inset-inline-start: 8px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transform: scaleY(0.45);
    opacity: 0;
    transition: transform var(--ease), opacity var(--ease), background var(--ease);
}

.sidebar a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(42, 171, 238, 0.12), rgba(99, 91, 255, 0.08));
    opacity: 0;
    transition: opacity var(--ease);
}

.sidebar a:hover {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
    border-color: rgba(42, 171, 238, 0.34);
    color: #ffffff;
    transform: translateX(-3px);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.18);
}

.sidebar a:hover::before {
    background: var(--telegram);
    opacity: 1;
    transform: scaleY(1);
}

.sidebar a:hover::after {
    opacity: 1;
}

.sidebar a.active,
.sidebar a[aria-current="page"] {
    background: linear-gradient(135deg, var(--primary), var(--telegram));
    border-color: rgba(147, 197, 253, 0.58);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.26);
}

.sidebar a.active::before,
.sidebar a[aria-current="page"]::before {
    background: var(--surface-solid);
    opacity: 1;
    transform: scaleY(1);
}

@media (max-width: 768px) {
    .sidebar {
        position: sticky;
        top: 60px;
        right: auto;
        bottom: auto;
        width: 100%;
        max-height: 0;
        height: auto;
        padding: 0 10px;
        overflow: hidden;
        visibility: visible;
        transform: none;
        border-radius: 0;
        border-inline-end: 0;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
        transition: max-height 0.25s ease, padding 0.25s ease, box-shadow 0.25s ease;
    }

    .sidebar a {
        margin-bottom: 8px;
        transform: none;
    }

}

/* ===== Sidebar Active State & Mobile Height Refinement ===== */
.sidebar a:local-link::after,
.sidebar a.active::after,
.sidebar a[aria-current="page"]::after {
    opacity: 0;
}

@media (max-width: 768px) {
    .sidebar {
        top: 60px;
        max-height: 0;
        min-height: 0;
        padding-block: 0;
    }

    .sidebar a {
        min-height: 46px;
        margin-bottom: 9px;
    }

}

/* ===== Sidebar Final Behavior Alignment ===== */
@media (min-width: 769px) {
    .sidebar {
        top: 68px;
        height: calc(100vh - 68px);
        min-height: calc(100vh - 68px);
        max-height: calc(100vh - 68px);
        padding-bottom: 18px;
    }

}

@media (max-width: 768px) {
    .sidebar {
        position: sticky;
        top: 60px;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: 0;
        padding: 0 10px;
        overflow: hidden;
        transform: none;
        visibility: visible;
    }

    .sidebar.active {
        height: auto;
        min-height: 0;
        max-height: 70vh;
        padding: 12px 10px;
        overflow-y: auto;
        transform: none;
        visibility: visible;
    }
}

.sidebar a:local-link,
.sidebar a.active,
.sidebar a[aria-current="page"] {
    background: linear-gradient(135deg, var(--primary), var(--telegram));
    border-color: rgba(147, 197, 253, 0.64);
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

.sidebar a:local-link::before,
.sidebar a.active::before,
.sidebar a[aria-current="page"]::before {
    background: var(--surface-solid);
    opacity: 1;
    transform: scaleY(1);
}

/* ===== Order Action Buttons Polish ===== */
.order-details-content form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.order-details-content button[name="get_code"],
.order-details-content button[name="change_number"],
.order-details-content button[name="cancel"],
.orders-actions .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        opacity 180ms ease;
}

.order-details-content button[name="get_code"] {
    background: linear-gradient(135deg, var(--primary), var(--telegram));
    border-color: rgba(147, 197, 253, 0.48);
}

.order-details-content button[name="change_number"] {
    background: linear-gradient(135deg, #4338ca, var(--stripe));
    border-color: rgba(196, 181, 253, 0.5);
    box-shadow: 0 12px 26px rgba(99, 91, 255, 0.24);
}

.order-details-content button[name="cancel"],
.orders-actions .btn-danger {
    background: linear-gradient(135deg, var(--danger), #f97316) !important;
    border-color: rgba(254, 202, 202, 0.48) !important;
    box-shadow: 0 12px 26px rgba(239, 68, 68, 0.22) !important;
}

.order-details-content button[name="get_code"]:hover,
.order-details-content button[name="change_number"]:hover,
.order-details-content button[name="cancel"]:hover,
.orders-actions .btn-danger:hover {
    transform: translateY(-2px);
}

.order-details-content button[name="get_code"]:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--stripe));
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.order-details-content button[name="change_number"]:hover {
    background: linear-gradient(135deg, #3730a3, #7c3aed);
    box-shadow: 0 18px 34px rgba(99, 91, 255, 0.3);
}

.order-details-content button[name="cancel"]:hover,
.orders-actions .btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark), #ea580c) !important;
    box-shadow: 0 18px 34px rgba(239, 68, 68, 0.28) !important;
}

.orders-actions .inline-form {
    flex: 1 1 150px;
}

.orders-actions .btn-danger {
    width: 100%;
    min-width: 150px;
}

@media (max-width: 768px) {
    .order-details-content form {
        align-items: stretch;
    }

    .order-details-content button[name="get_code"],
    .order-details-content button[name="change_number"],
    .order-details-content button[name="cancel"],
    .orders-actions .btn-danger {
        width: 100%;
    }
}

/* ===== Mobile Header & Sidebar User Card ===== */
.sidebar-user-card,
.sidebar-logout {
    display: none;
}

@media (max-width: 768px) {
    .header {
        justify-content: flex-start;
        gap: 10px;
        min-height: 62px;
    }

    .header .user-info {
        display: none;
    }

    .header .theme-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        order: 3;
    }

    .menu-toggle {
        flex: 0 0 42px;
        order: 1;
    }

    .logo {
        order: 2;
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.35;
        font-size: 16px;
        text-align: start;
        overflow-wrap: anywhere;
    }

    .sidebar-user-card {
        display: grid;
        gap: 8px;
        margin: 2px 4px 14px;
        padding: 16px 14px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background:
            linear-gradient(135deg, rgba(42, 171, 238, 0.12), rgba(99, 91, 255, 0.08)),
            var(--surface-muted);
        color: var(--text);
        box-shadow: 0 14px 30px var(--shadow-color);
    }

    .sidebar-user-icon {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--primary), var(--telegram));
        color: #ffffff;
        font-size: 22px;
        box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    }

    .sidebar-user-name {
        color: var(--text);
        font-size: 15px;
        font-weight: 900;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    .sidebar-user-balance {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        width: fit-content;
        max-width: 100%;
        padding: 7px 11px;
        border-radius: 999px;
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(42, 171, 238, 0.1));
        border: 1px solid rgba(16, 185, 129, 0.28);
        color: var(--text);
        font-size: 13px;
        font-weight: 800;
        overflow-wrap: anywhere;
    }

    .sidebar-logout {
        display: flex;
        margin-top: 8px;
        border-color: rgba(239, 68, 68, 0.28);
        background:
            linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08)),
            var(--sidebar-link);
    }

    .sidebar-logout:hover {
        border-color: rgba(239, 68, 68, 0.48);
        background:
            linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(249, 115, 22, 0.12)),
            var(--sidebar-link-hover);
    }
}

@media (max-width: 420px) {
    .logo {
        max-width: none;
        font-size: 15px;
    }
}

/* ===== Theme System: Light / Dark Mode ===== */
:root,
html[data-theme="light"] {
    color-scheme: light;
    --bg-page: #f6f8fb;
    --background: #f6f8fb;
    --background-accent-1: rgba(42, 171, 238, 0.16);
    --background-accent-2: rgba(99, 91, 255, 0.14);
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-muted: #f8fafc;
    --text: #0f172a;
    --text-main: var(--text);
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    --border: rgba(148, 163, 184, 0.26);
    --border-soft: var(--border);
    --border-strong: rgba(15, 23, 42, 0.08);
    --header-bg: rgba(255, 255, 255, 0.86);
    --sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 52%, rgba(241, 245, 249, 0.98) 100%);
    --sidebar-link: linear-gradient(135deg, rgba(37, 99, 235, 0.055), rgba(42, 171, 238, 0.035));
    --sidebar-link-hover: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(42, 171, 238, 0.075));
    --sidebar-text: #1e293b;
    --message-success-bg: #ecfdf5;
    --message-success-text: #065f46;
    --message-error-bg: #fff1f2;
    --message-error-text: #991b1b;
    --github: #24292f;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 18px 44px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.18);
    --shadow-color: rgba(15, 23, 42, 0.12);
    --ease: 180ms ease;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --telegram: #2aabee;
    --stripe: #635bff;
    --success: #10b981;
    --success-dark: #047857;
    --danger: #ef4444;
    --danger-dark: #dc2626;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --background: #0f172a;
    --background-accent-1: rgba(42, 171, 238, 0.11);
    --background-accent-2: rgba(99, 91, 255, 0.12);
    --surface: rgba(30, 41, 59, 0.94);
    --surface-solid: #1e293b;
    --surface-muted: #162033;
    --text: #f8fafc;
    --text-main: var(--text);
    --text-muted: #cbd5e1;
    --text-soft: #94a3b8;
    --border: #334155;
    --border-soft: var(--border);
    --border-strong: rgba(148, 163, 184, 0.24);
    --header-bg: rgba(15, 23, 42, 0.88);
    --sidebar-bg: linear-gradient(180deg, #020617 0%, #0f172a 48%, #111827 100%);
    --sidebar-link: linear-gradient(135deg, rgba(148, 163, 184, 0.16), rgba(15, 23, 42, 0.2));
    --sidebar-link-hover: linear-gradient(135deg, rgba(42, 171, 238, 0.16), rgba(99, 91, 255, 0.12));
    --sidebar-text: rgba(248, 250, 252, 0.88);
    --message-success-bg: rgba(16, 185, 129, 0.14);
    --message-success-text: #86efac;
    --message-error-bg: rgba(239, 68, 68, 0.14);
    --message-error-text: #fecaca;
    --shadow-color: rgba(0, 0, 0, 0.34);
    --primary: #3b82f6;
    --primary-dark: #2563eb;
}

html,
body,
.header,
.sidebar,
.main-content,
.footer,
.dashboard-card,
.number-card,
.orders-card,
.deposit-card,
.profile-info-card,
.profile-edit-card,
.stat-card,
.notification-item,
.last-orders,
.popup-box,
.purchase-overlay-box,
.checkout-modal-box,
.info-box,
.readonly-field,
input,
select,
textarea,
button,
a {
    transition:
        background-color 220ms ease,
        background 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease,
        color 220ms ease,
        opacity 220ms ease,
        transform 220ms ease;
}

body,
.checkout-page {
    background:
        radial-gradient(circle at top right, var(--background-accent-1), transparent 30%),
        radial-gradient(circle at 12% 0, var(--background-accent-2), transparent 28%),
        var(--background);
    color: var(--text);
}

.header {
    background: var(--header-bg);
    color: var(--text);
    border-bottom-color: var(--border);
}

.logo,
.hero-title,
.page-title,
.orders-page-title,
.main-content > h2,
.section-title,
.main-content > h3,
.number-value,
.orders-value,
.notification-title,
.notification-message,
.notification-date,
.profile-info-card h3,
.profile-edit-card h3,
.popup-box h3 {
    color: var(--text);
}

.user-info,
.welcome-text,
.deposit-note,
.checkout-error-text,
.number-info,
.orders-label,
.dashboard-card span,
.stat-card span,
.profile-info-card p,
.deposit-card p,
.popup-box p,
.readonly-field small {
    color: var(--text-muted);
}

.main-content,
.dashboard-card,
.number-card,
.orders-card,
.deposit-card,
.profile-info-card,
.profile-edit-card,
.stat-card,
.notification-item,
.last-orders,
.popup-box,
.purchase-overlay-box,
.checkout-modal-box {
    background: var(--surface);
    border-color: var(--border-strong);
    box-shadow: 0 18px 44px var(--shadow-color);
}

.notification-item.unread {
    background: linear-gradient(135deg, var(--surface-muted), var(--surface));
    border-color: var(--border);
}

table,
thead,
tbody,
tr,
td,
th {
    color: var(--text);
    border-color: var(--border);
}

thead,
th {
    background: var(--surface-muted);
}

.footer {
    background: var(--surface);
    border-top-color: var(--border);
    color: var(--text-muted);
}

.sidebar {
    background: var(--sidebar-bg), #0f172a;
    border-inline-end-color: var(--border);
}

.sidebar a {
    background: var(--sidebar-link);
    border-color: rgba(148, 163, 184, 0.16);
    color: var(--sidebar-text);
}

.sidebar a:hover {
    background: var(--sidebar-link-hover);
    border-color: rgba(42, 171, 238, 0.36);
}

html[data-theme="light"] .sidebar a:not(.active):not([aria-current="page"]):hover {
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
#searchBox,
.readonly-field,
.info-box {
    background: var(--surface-muted);
    border-color: var(--border);
    color: var(--text);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-soft);
}

.service-icon {
    background: var(--surface-solid);
    border-color: var(--border);
}

.hero-section {
    background:
        linear-gradient(135deg, var(--surface), var(--surface-muted)),
        radial-gradient(circle at top right, var(--background-accent-1), transparent 34%);
    border-color: var(--border-strong);
}

.hero-logo,
.hero-features span {
    background: var(--surface-solid);
    border-color: var(--border);
}

.empty-message {
    background: var(--surface-muted);
    color: var(--text-muted);
    border-color: var(--border);
}

.success-message {
    background: var(--message-success-bg);
    color: var(--message-success-text);
    border-color: rgba(16, 185, 129, 0.32);
}

.error-message,
.canceled-message {
    background: var(--message-error-bg);
    color: var(--message-error-text);
    border-color: rgba(239, 68, 68, 0.32);
}

.order-status,
.orders-status {
    background: var(--surface-muted);
    color: var(--text-muted);
    border-color: var(--border);
}

.status-pending {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.status-received {
    background: var(--message-success-bg);
    color: var(--message-success-text);
}

.status-canceled {
    background: var(--message-error-bg);
    color: var(--message-error-text);
}

.order-item,
.profile-edit-card hr,
.deposit-card hr,
.main-content hr {
    border-color: var(--border);
}

.code-box,
.wallet-display,
.balance-box,
.current-balance {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(42, 171, 238, 0.1));
    color: var(--message-success-text);
    border-color: rgba(16, 185, 129, 0.34);
}

.purchase-overlay,
.checkout-modal,
.popup-overlay {
    background:
        radial-gradient(circle at top, rgba(42, 171, 238, 0.18), transparent 36%),
        rgba(2, 6, 23, 0.72);
}

/* Purchase wait overlay: this must stay after older overlay rules so the inline UI display keeps flex centering. */
.purchase-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
    pointer-events: auto;
    background:
        radial-gradient(circle at top, color-mix(in srgb, var(--primary) 18%, transparent), transparent 38%),
        color-mix(in srgb, var(--background) 82%, transparent);
    animation: purchaseOverlayFadeIn 0.18s ease both;
}

body.purchase-overlay-active {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

.purchase-overlay-box {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 14px;
    width: min(92vw, 420px);
    padding: 32px 26px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 16px;
    line-height: 1.8;
    box-shadow: 0 22px 60px var(--shadow-color);
    animation: purchaseOverlayBoxIn 0.22s ease both;
}

.purchase-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-block-start-color: var(--primary);
    border-radius: 50%;
    animation: purchaseSpinner 0.85s linear infinite;
}

.purchase-overlay-title {
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
}

.purchase-overlay-note {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
    text-align: center;
}

@keyframes purchaseOverlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes purchaseOverlayBoxIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes purchaseSpinner {
    to {
        transform: rotate(360deg);
    }
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    width: 66px;
    height: 36px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    box-shadow: 0 8px 18px var(--shadow-color);
    cursor: pointer;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff, #dbeafe);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    transition: transform 220ms ease, background 220ms ease;
}

.theme-toggle-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 15px;
    line-height: 1;
}

html[data-theme="dark"] .theme-toggle::before {
    transform: translateX(-30px);
    background: linear-gradient(135deg, #1e293b, #334155);
}

html[data-theme="dark"] .theme-toggle {
    background: #0f172a;
}

.theme-toggle:hover {
    border-color: rgba(42, 171, 238, 0.48);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .theme-toggle {
        width: 60px;
        height: 34px;
        order: 2;
    }

    .theme-toggle::before {
        width: 26px;
        height: 26px;
    }

    html[data-theme="dark"] .theme-toggle::before {
        transform: translateX(-26px);
    }
}
