/**
 * Xcr9 Host - Spatial Glassmorphism 2.0 Dashboard & Admin CSS
 * High-End OLED Dark Theme (#000000) for User Panel and System Admin
 */

/* ======================== LAYOUT & WRAPPER ======================== */
.panel-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: transparent; /* Changed from var(--bg-oled) to show ambient orbs */
    position: relative;
    overflow-x: hidden;
}

/* ======================== SIDEBAR ======================== */
.panel-sidebar {
    width: 250px;
    min-width: 250px;
    background: rgba(6, 10, 20, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.4rem 1.3rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.sidebar-menu li { 
    padding: 0 0.75rem; 
    margin-bottom: 0.3rem; 
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    border: 1px solid transparent;
}

.sidebar-link:hover { 
    background: rgba(255, 255, 255, 0.06); 
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active { 
    background: rgba(0, 242, 254, 0.12); 
    color: var(--neon-blue);
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
    border-right: 3px solid var(--neon-blue);
}

.sidebar-link .icon { 
    font-size: 1.1rem; 
    width: 24px; 
    text-align: center; 
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.3rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
}

.user-avatar {
    width: 38px; 
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-cyan-teal);
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-weight: 900; 
    font-size: 1rem; 
    color: #020617; 
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.user-name { 
    font-size: 0.88rem; 
    font-weight: 800; 
    color: var(--text-main); 
    margin-bottom: 0.15rem; 
}

.user-wallet { 
    font-size: 0.75rem; 
    color: var(--neon-teal); 
    font-weight: 800; 
    font-family: var(--font-fa);
}

/* ======================== MAIN CONTENT ======================== */
.panel-main {
    flex: 1;
    margin-right: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.panel-navbar {
    position: sticky; 
    top: 0; 
    z-index: 50;
    background: rgba(6, 10, 20, 0.82);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-light);
    padding: 1rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
}

.panel-title { 
    font-size: 1.2rem; 
    font-weight: 900; 
    color: var(--text-main); 
}

.tab-content {
    display: none;
    padding: 2rem 1.8rem;
    flex: 1;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active { display: block; }

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

/* ======================== METRICS STRIP ======================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 2rem;
    padding: 0.35rem 0 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-stat {
    appearance: none;
    background: transparent;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.35rem 1.1rem;
    margin: 0;
    text-align: right;
    font-family: inherit;
    min-width: 0;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.metric-stat:first-child {
    border-left: 0;
    padding-right: 0;
}

.metric-stat:last-child {
    padding-left: 0;
}

.metric-stat:hover .metric-val,
.metric-stat:focus-visible .metric-val {
    color: var(--primary-cyan, #00f2fe);
}

.metric-stat:hover .metric-label,
.metric-stat:focus-visible .metric-label {
    color: rgba(255, 255, 255, 0.78);
}

.metric-stat:focus-visible {
    outline: 1px solid rgba(0, 242, 254, 0.45);
    outline-offset: 3px;
}

.metric-val {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    font-family: var(--font-fa);
    color: #fff;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

/* Keep legacy class harmless if used elsewhere */
.metric-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
}
.metric-card::before { display: none !important; }
.metric-icon { display: none !important; }

/* ======================== SERVER CARDS ======================== */
.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
}

.server-panel-card { 
    padding: 1.35rem !important; 
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    min-width: 0;
}

.server-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    gap: 0.75rem;
    min-width: 0;
}

.server-title-box { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.server-title-box > div {
    min-width: 0;
}

.server-flag { 
    font-size: 1.6rem;
    flex-shrink: 0;
}

.server-name { 
    font-size: 1.05rem; 
    font-weight: 800; 
    margin-bottom: 0.2rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.server-ip { 
    font-size: 0.82rem; 
    color: var(--neon-blue); 
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; 
    direction: ltr;
    unicode-bidi: plaintext;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.server-specs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 0.85rem 0.7rem;
    margin-bottom: 1.2rem;
}

@media (min-width: 520px) {
    .server-specs-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.spec-cell {
    text-align: center;
    min-width: 0;
    overflow: hidden;
}

.spec-cell-label { 
    display: block; 
    font-size: 0.68rem; 
    color: var(--text-dim); 
    margin-bottom: 0.2rem; 
}

.spec-cell-val { 
    display: block;
    font-size: 0.78rem; 
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.server-actions-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.server-actions-bar .btn {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
}

.server-pending-card {
    border-color: rgba(245, 158, 11, 0.35) !important;
}

.server-pending-note {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent-gold, #f59e0b);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.server-cancelled-card {
    border-color: rgba(148, 163, 184, 0.35) !important;
    opacity: 0.72;
    filter: grayscale(0.85);
}

.server-cancelled-card .server-name,
.server-cancelled-card .server-ip,
.server-cancelled-card .spec-cell-val {
    color: #94a3b8 !important;
}

.server-cancelled-note {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #94a3b8;
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.server-expired-card {
    border-color: rgba(239, 68, 68, 0.28) !important;
    opacity: 0.88;
}

.server-actions-bar .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ======================== STATUS BADGES ======================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

@keyframes pulseActive {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--neon-emerald);
    border: 1px solid rgba(16, 185, 129, 0.35);
    animation: pulseActive 2s infinite;
}

.status-stopped {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-cancelled {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ======================== TABLES SYSTEM ======================== */
.table-glass-container {
    background: var(--glass-fill);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-inner-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.tickets-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.88rem; 
}

.tickets-table th, .tickets-table td { 
    padding: 0.9rem 1.1rem; 
    text-align: right; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.07); 
}

.tickets-table th { 
    color: var(--neon-blue); 
    font-weight: 800; 
    font-size: 0.8rem; 
    background: rgba(0, 0, 0, 0.45); 
}

.tickets-table tr:hover td { 
    background: rgba(255, 255, 255, 0.04); 
}

/* ======================== TICKETS LIST ======================== */
.tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.tickets-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.tickets-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tickets-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    line-height: 1.7;
}

.ticket-card {
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.ticket-card:hover {
    border-color: rgba(0, 242, 254, 0.35);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.ticket-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.ticket-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    color: var(--primary-cyan, #00f2fe);
    direction: ltr;
    font-size: 0.9rem;
}

.ticket-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.ticket-status-open {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

.ticket-status-replied {
    background: rgba(0, 242, 254, 0.12);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.ticket-status-closed {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ticket-subject {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.45;
    word-break: break-word;
}

.ticket-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.9rem;
}

.ticket-card-action {
    display: flex;
    justify-content: flex-end;
}

/* ======================== TICKET RELATED PICKER ======================== */
.ticket-related-box {
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.18);
    border-radius: var(--radius-lg);
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
}

.ticket-related-title {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 0.25rem;
}

.ticket-related-hint {
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.ticket-related-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.ticket-related-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    line-height: 1.4;
}

.ticket-related-chip strong {
    font-weight: 800;
}

.ticket-related-chip.server {
    border-color: rgba(0, 242, 254, 0.28);
    background: rgba(0, 242, 254, 0.08);
}

.ticket-related-chip.invoice {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
}

.ticket-related-chip .chip-sub {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.ticket-card-related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.ticket-card-related span {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

/* ======================== TICKET CHAT ======================== */
.modal-backdrop:has(.thread-modal-content) {
    padding: 1rem;
    align-items: stretch;
}

.thread-modal-content {
    max-width: min(960px, 96vw) !important;
    width: 100% !important;
    height: min(92vh, 900px) !important;
    max-height: min(92vh, 900px) !important;
    display: flex !important;
    flex-direction: column;
    padding: 1.15rem 1.35rem !important;
    overflow: hidden !important;
    margin: auto;
}

.thread-modal-content .modal-header {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
    align-items: flex-start;
    gap: 0.75rem;
}

.thread-modal-content .modal-title {
    font-size: 1.15rem;
    line-height: 1.4;
    word-break: break-word;
}

.thread-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: center;
}

.thread-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
}

.ticket-chat-box {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.15rem 1.25rem;
    background: rgba(0, 0, 0, 0.45);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 242, 254, 0.35) transparent;
}

.ticket-chat-box::-webkit-scrollbar { width: 6px; }
.ticket-chat-box::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.3);
    border-radius: 999px;
}

.chat-bubble {
    max-width: min(78%, 640px);
    padding: 0.85rem 1.05rem;
    border-radius: var(--radius-lg);
    font-size: 0.92rem;
    line-height: 1.7;
    position: relative;
    word-break: break-word;
}

.chat-bubble.user {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.25);
    align-self: flex-end;
    border-bottom-left-radius: 0.35rem;
}

.chat-bubble.support {
    background: rgba(127, 83, 172, 0.18);
    border: 1px solid rgba(127, 83, 172, 0.3);
    align-self: flex-start;
    border-bottom-right-radius: 0.35rem;
}

.chat-author {
    font-weight: 700;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    opacity: 0.9;
}

.chat-text {
    white-space: pre-wrap;
}

.chat-time { 
    font-size: 0.72rem; 
    color: var(--text-dim); 
    margin-top: 0.4rem; 
    direction: ltr; 
    text-align: left;
}

.thread-reply-form {
    display: flex;
    gap: 0.65rem;
    align-items: flex-end;
    flex-shrink: 0;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.thread-reply-input {
    flex: 1;
    resize: none;
    min-height: 56px;
    max-height: 160px;
    line-height: 1.55;
}

.thread-reply-aside {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-shrink: 0;
}

.thread-reply-btn {
    white-space: nowrap;
    min-height: 48px;
    padding-inline: 1.2rem;
}

.thread-reply-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.3;
}

.thread-closed-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    margin-top: 0.85rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .modal-backdrop:has(.thread-modal-content) {
        padding: 0;
        align-items: stretch;
    }

    .thread-modal-content {
        max-width: 100% !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        padding: 0.9rem 0.95rem calc(0.9rem + env(safe-area-inset-bottom)) !important;
    }

    .ticket-chat-box {
        padding: 0.85rem;
        gap: 0.7rem;
    }

    .chat-bubble {
        max-width: 90%;
        font-size: 0.88rem;
    }

    .thread-reply-form {
        flex-direction: column;
        align-items: stretch;
    }

    .thread-reply-aside {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .thread-reply-btn {
        flex: 1;
        min-height: 44px;
    }

    .thread-reply-hint {
        display: none;
    }

    .ticket-card-meta {
        gap: 0.35rem 0.7rem;
    }
}

/* ======================== BILLING / WALLET ======================== */
.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.billing-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.billing-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.wallet-hero {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0, 242, 254, 0.18), transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(127, 83, 172, 0.16), transparent 50%),
        var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1.4rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.wallet-hero-label {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.wallet-hero-amount {
    font-size: clamp(1.7rem, 5vw, 2.3rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    direction: ltr;
    unicode-bidi: plaintext;
}

.wallet-hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.billing-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.billing-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.invoice-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.invoice-filter {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.invoice-filter.active,
.invoice-filter:hover {
    color: #fff;
    border-color: rgba(0, 242, 254, 0.4);
    background: rgba(0, 242, 254, 0.12);
}

.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.invoice-card {
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.1rem 1.25rem;
}

.invoice-card.is-pending {
    border-color: rgba(255, 193, 7, 0.28);
}

.invoice-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.invoice-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 700;
    color: var(--primary-cyan, #00f2fe);
    direction: ltr;
    font-size: 0.9rem;
}

.invoice-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}

.invoice-status-paid {
    background: rgba(0, 242, 254, 0.12);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.invoice-status-pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.35);
}

.invoice-title {
    margin: 0 0 0.55rem;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.45;
    word-break: break-word;
}

.invoice-amount {
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.7rem;
    direction: ltr;
    unicode-bidi: plaintext;
}

.invoice-amount span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.invoice-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.invoice-card-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.9rem;
}

.invoice-waiting {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 640px) {
    .wallet-hero {
        padding: 1.25rem 1rem;
    }

    .invoice-card-action {
        justify-content: stretch;
    }

    .invoice-card-action .btn {
        width: 100%;
    }
}

/* ======================== CHECKOUT / ORDER NEW ======================== */
.checkout-header {
    margin-bottom: 1.25rem;
}

.checkout-heading {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.checkout-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 1.25rem;
    align-items: start;
}

.checkout-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.checkout-step {
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.2rem 1.25rem;
}

.checkout-step-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.checkout-step-num {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    background: rgba(0, 242, 254, 0.12);
    color: var(--primary-cyan, #00f2fe);
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.checkout-step-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.plan-provider-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.plan-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.95rem;
    padding: 0.85rem 0.9rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
}

.plan-filter-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
}

.plan-filters .plan-provider-filters {
    margin-bottom: 0;
}

.plan-filter-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-filter-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
}

.plan-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.55rem 0.65rem;
}

.plan-filter-field {
    margin: 0;
}

.plan-filter-field .form-label {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
}

.plan-filter-field .form-input {
    padding: 0.55rem 0.7rem;
    font-size: 0.82rem;
}

.plan-pick-cat {
    font-size: 0.72rem;
    color: var(--primary-cyan);
    font-weight: 700;
    margin: 0.15rem 0 0.35rem;
}

.plan-pick-loc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .plan-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .plan-filter-field:first-child {
        grid-column: 1 / -1;
    }
}

.checkout-plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 0.75rem;
}

.plan-pick-card {
    display: flex;
    flex-direction: column;
    text-align: right;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 0.95rem;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.plan-pick-card:hover {
    border-color: rgba(0, 242, 254, 0.35);
    transform: translateY(-1px);
}

.plan-pick-card.selected {
    border-color: rgba(0, 242, 254, 0.55);
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 0 1px rgba(0, 242, 254, 0.15);
}

.plan-pick-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    min-width: 0;
}

.plan-pick-provider {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-pick-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

.plan-pick-name {
    font-weight: 800;
    font-size: 0.98rem;
    margin-bottom: 0.55rem;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.plan-pick-specs {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.76rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
    min-height: 3.4em;
    flex: 1;
    min-width: 0;
}

.plan-pick-specs span {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.plan-pick-price {
    margin-top: auto;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0;
    overflow: hidden;
}

.plan-pick-price strong {
    display: block;
    font-size: clamp(0.82rem, 2.4vw, 1.05rem);
    font-weight: 900;
    color: var(--primary-cyan, #00f2fe);
    direction: ltr;
    unicode-bidi: plaintext;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}

.plan-pick-price small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.checkout-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}

.checkout-config-hint {
    margin: -0.35rem 0 0.95rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

#checkout-config-step.is-focused {
    border-color: rgba(0, 242, 254, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 242, 254, 0.18), 0 10px 28px rgba(0, 0, 0, 0.22);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.period-options,
.pay-method-options {
    display: grid;
    gap: 0.55rem;
}

.period-options {
    grid-template-columns: repeat(4, 1fr);
}

.checkout-summary .period-options {
    grid-template-columns: repeat(2, 1fr);
}

.pay-method-options {
    grid-template-columns: 1fr;
}

.checkout-summary-block {
    margin-bottom: 0.95rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.checkout-summary-block-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
}

.checkout-summary .pay-method-option {
    padding: 0.7rem 0.8rem;
}

.checkout-summary .pay-method-body strong {
    font-size: 0.86rem;
}

.checkout-summary .pay-method-body small {
    font-size: 0.72rem;
}

.checkout-coupon-group {
    margin: 0 0 0.85rem;
}

.period-option,
.pay-method-option {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.period-option {
    padding: 0.7rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.pay-method-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    text-align: right;
}

.period-option.active,
.pay-method-option.active {
    border-color: rgba(0, 242, 254, 0.5);
    background: rgba(0, 242, 254, 0.1);
}

.pay-method-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.pay-method-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pay-method-body strong {
    font-size: 0.92rem;
}

.pay-method-body small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.checkout-summary {
    position: sticky;
    top: 1rem;
    background: var(--glass-fill);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.15rem 1.2rem;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
}

.checkout-summary-title {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.checkout-summary-plan {
    background: rgba(0, 242, 254, 0.07);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    margin-bottom: 1rem;
}

.checkout-summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.checkout-summary-name {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.checkout-summary-monthly {
    font-size: 0.82rem;
    color: var(--primary-cyan, #00f2fe);
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkout-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.1rem;
    font-size: 0.88rem;
}

.checkout-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.checkout-summary-row span:last-child {
    color: #fff;
    font-weight: 700;
    text-align: left;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 65%;
}

.checkout-summary-row.total {
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.checkout-summary-row.total span:last-child {
    color: var(--primary-cyan, #00f2fe);
    font-weight: 900;
    font-size: 1.05rem;
}

.checkout-submit {
    width: 100%;
    padding: 0.95rem 1rem;
    font-size: 1rem;
}

.checkout-summary-note {
    margin: 0.75rem 0 0;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.55;
    text-align: center;
}

@media (max-width: 960px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
        order: 2;
    }

    .checkout-main {
        order: 1;
    }
}

@media (max-width: 640px) {
    .checkout-config-grid {
        grid-template-columns: 1fr;
    }

    .period-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .checkout-plans {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .checkout-plans {
        grid-template-columns: 1fr;
    }
}

/* ======================== MODALS ======================== */
.modal-backdrop {
    position: fixed; 
    inset: 0; 
    z-index: 1500;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-backdrop.active { display: flex; }

.modal-content {
    background: rgba(10, 14, 24, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25), 0 30px 80px rgba(0, 242, 254, 0.2);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn { 
    from { opacity: 0; transform: scale(0.95) translateY(12px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}

.modal-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 1.4rem; 
}

.modal-title { 
    font-size: 1.25rem; 
    font-weight: 900; 
}

.modal-close { 
    background: rgba(255, 255, 255, 0.06); 
    border: 1px solid var(--glass-border); 
    font-size: 1.2rem; 
    color: var(--text-muted); 
    cursor: pointer; 
    width: 32px;
    height: 32px;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover { 
    color: #fff; 
    background: rgba(255, 255, 255, 0.2); 
}

/* ======================== MOBILE SIDEBAR TOGGLE ======================== */
.panel-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.panel-menu-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.panel-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.panel-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.panel-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.panel-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 90;
    backdrop-filter: blur(2px);
}

.panel-sidebar-overlay.open { display: block; }

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1024px) {
    .panel-sidebar { width: 220px; min-width: 220px; }
    .panel-main { margin-right: 220px; }
    .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.85rem 0; }
    .metric-stat { border-left: 0; padding: 0.2rem 0.4rem 0.2rem 0; }
    .metric-stat:nth-child(3n+1) { padding-right: 0; }
}

@media (max-width: 768px) {
    .panel-menu-toggle { display: inline-flex; }

    .panel-sidebar {
        display: flex;
        transform: translateX(105%);
        width: min(280px, 84vw);
        min-width: 0;
        box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
    }

    .panel-sidebar.open {
        transform: translateX(0);
    }

    .panel-main { margin-right: 0; }

    .panel-navbar {
        gap: 0.6rem;
        flex-wrap: wrap;
        padding: 0.85rem 1rem;
    }

    .panel-navbar .panel-title {
        flex: 1;
        min-width: 0;
        font-size: 1.05rem;
    }

    .panel-navbar .btn-sm {
        padding: 0.45rem 0.7rem;
        font-size: 0.78rem;
    }

    .metrics-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem 0.5rem; border-bottom-color: rgba(255,255,255,0.08); }
    .metric-stat { border-left: 0; padding: 0.15rem 0.25rem 0.15rem 0; }
    .servers-grid { grid-template-columns: 1fr; }
    .server-specs-row { grid-template-columns: repeat(2, 1fr); }

    .notif-card {
        grid-template-columns: 36px 1fr;
    }
    .notif-card-action { display: none; }
}

@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .metric-val { font-size: 1.4rem; }
    .panel-navbar .btn-primary span,
    .panel-navbar .btn-primary { font-size: 0.75rem; }
}
