:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #101623;
    --bg-card: #151d2f;
    --border-color: #232f48;
    --border-hover: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-cyan: #06b6d4;
    --radius: 12px;
    --glow: 0 0 20px rgba(239, 68, 68, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Navbar */
.navbar {
    background-color: rgba(16, 22, 35, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-brand img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.4));
}

.nav-brand span.pvd {
    color: var(--accent-red);
}

/* Desktop Navigation (min-width: 993px) */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    margin-left: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.nav-links a {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.45rem !important;
    white-space: nowrap !important;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    line-height: 1 !important;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: #fff;
    background-color: rgba(239, 68, 68, 0.12);
}

.nav-panel-link {
    color: #38bdf8 !important;
}

.nav-panel-link:hover {
    background-color: rgba(56, 189, 248, 0.12) !important;
}

.nav-ext-icon {
    font-size: 0.7rem;
    margin-left: 2px;
    opacity: 0.8;
}

.nav-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.coin-badge {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.btn-logout {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.45rem !important;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    line-height: 1 !important;
    white-space: nowrap !important;
    transition: all 0.2s;
}

.btn-logout:hover {
    color: #fff;
    border-color: var(--accent-red);
    background-color: rgba(239, 68, 68, 0.15);
}

.nav-toggle, .mobile-coin-badge {
    display: none;
}

/* Mobile & Tablet Styles (<= 992px) */
@media (max-width: 992px) {
    .nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: #fff;
        font-size: 1.25rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .nav-toggle:active {
        transform: scale(0.95);
        border-color: var(--accent-red);
    }

    .desktop-coin-badge {
        display: none !important;
    }

    .mobile-coin-badge {
        display: inline-flex !important;
        align-items: center;
        gap: 0.35rem;
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
        border: 1px solid rgba(245, 158, 11, 0.4);
        color: #fbbf24;
        padding: 0.35rem 0.75rem;
        border-radius: 9999px;
        font-weight: 700;
        font-size: 0.85rem;
        margin-left: auto;
        margin-right: 0.65rem;
        white-space: nowrap;
    }

    .nav-menu-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(14, 20, 32, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-bottom: 2px solid var(--border-color);
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        gap: 1.25rem;
        margin-left: 0;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
        z-index: 1000;
    }

    .nav-menu-wrapper.open {
        display: flex !important;
        animation: slideDown 0.25s ease-out forwards;
    }

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

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.85rem 1rem !important;
        width: 100% !important;
        font-size: 1rem !important;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
    }

    .nav-menu-wrapper .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-color);
    }

    .btn-logout {
        justify-content: center !important;
        padding: 0.85rem !important;
        font-size: 0.95rem !important;
        width: 100% !important;
    }

    .user-pill {
        justify-content: center;
        padding: 0.4rem 0;
        font-size: 0.95rem;
    }
}

/* Guest Navigation Styling */
.nav-guest-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-nav-auth {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.85rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.65rem 0.85rem;
    }

    .nav-brand {
        font-size: 1.05rem;
        gap: 0.45rem;
    }

    .nav-brand img {
        height: 28px;
    }

    .nav-guest-actions {
        gap: 0.35rem;
    }

    .btn-nav-auth {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.8rem !important;
        gap: 0.3rem !important;
    }
}

/* Main Layout */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Responsive Grids */
.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.responsive-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .responsive-plan-grid {
        grid-template-columns: 1fr !important;
    }
    .grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    .main-content {
        padding: 1.25rem 1rem !important;
    }
    .nav-container {
        padding: 0.75rem 1rem !important;
    }
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: var(--glow);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-success {
    background-color: var(--accent-green);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.plan-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
    padding: 0.25rem 0.55rem !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

.plan-badge-std {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.plan-badge-pro {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(239, 68, 68, 0.4) rgba(15, 23, 42, 0.7);
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 9999px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.4);
    border-radius: 9999px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

thead {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

th {
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(35, 47, 72, 0.5);
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
    border-bottom: none;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* Progress bar */
.progress-container {
    width: 100%;
    height: 10px;
    background-color: var(--bg-secondary);
    border-radius: 9999px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    transition: width 0.3s ease;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* ========================================================
   MODERN SERVER DASHBOARD (CARD GRID STYLE)
======================================================== */
.servers-page-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.highlight-text, .highlight-icon {
    color: var(--accent-red);
}

.page-subtitle {
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

.deploy-cta-btn {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.empty-server-card {
    text-align: center;
    padding: 4rem 1.5rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: var(--accent-red);
}

/* Card Grid Layout */
.pvd-servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Server Card matching user screenshot */
.pvd-server-card {
    background: #18191d;
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pvd-server-card:hover {
    border-color: rgba(167, 139, 250, 0.85);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
    transform: translateY(-2px);
}

.pvd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.pvd-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    word-break: break-word;
}

.pvd-card-uuid {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pvd-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.pvd-prop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
}

.pvd-prop-label {
    color: #94a3b8;
    font-weight: 500;
}

.pvd-prop-val {
    color: #f1f5f9;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.pvd-badge-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1;
}

.pvd-status-active {
    background: #16a34a;
    color: #ffffff;
}

.pvd-status-suspended {
    background: #dc2626;
    color: #ffffff;
}

.pvd-info-icon {
    color: #64748b;
    font-size: 0.85rem;
    cursor: help;
    transition: color 0.15s ease;
}

.pvd-info-icon:hover {
    color: #cbd5e1;
}

.pvd-created-date {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.pvd-price-row {
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    align-items: flex-start;
}

.pvd-sub-label {
    color: #64748b;
    font-size: 0.8rem;
}

.pvd-price-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

/* Manage Server Button at Bottom of Card */
.pvd-card-actions {
    margin-top: 1.5rem;
}

.pvd-manage-single-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    height: 46px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(167, 139, 250, 0.3);
    transition: all 0.2s ease;
}

.pvd-manage-single-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 6px 22px rgba(124, 58, 237, 0.6);
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.6);
    color: #ffffff !important;
}

.pvd-manage-single-btn:active {
    transform: translateY(0);
}

.copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

