/* ─── Variables ───────────────────────────────────────────────────────── */
:root {
    --bg: #050510;
    --bg-card: rgba(14, 14, 30, 0.75);
    --bg-card-hover: rgba(22, 22, 45, 0.85);
    --bg-card-solid: #0e0e1e;
    --bg-input: rgba(18, 18, 38, 0.8);
    --bg-nav: rgba(8, 8, 20, 0.85);
    --border: rgba(80, 60, 200, 0.15);
    --border-light: rgba(120, 90, 255, 0.25);
    --border-glow: rgba(120, 90, 255, 0.4);
    --primary: #7c5cfc;
    --primary-hover: #9478ff;
    --primary-glow: rgba(124, 92, 252, 0.35);
    --primary-glow-lg: rgba(124, 92, 252, 0.15);
    --secondary: rgba(40, 35, 70, 0.6);
    --secondary-hover: rgba(55, 48, 95, 0.7);
    --accent: #00e5ff;
    --accent-glow: rgba(0, 229, 255, 0.25);
    --accent2: #ff6bcb;
    --accent2-glow: rgba(255, 107, 203, 0.2);
    --success: #00e5a0;
    --success-glow: rgba(0, 229, 160, 0.2);
    --danger: #ff4d6a;
    --danger-hover: #e8364f;
    --warning: #ffbe2e;
    --text: #eeeef8;
    --text-muted: #9090b8;
    --text-dim: #5a5a80;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(124, 92, 252, 0.12);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --glass: saturate(180%) blur(20px);
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Stars Canvas ───────────────────────────────────────────────────── */
#starsCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Cosmic ambient glow blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

body::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 92, 252, 0.18), transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatBlob1 25s ease-in-out infinite;
}

body::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.12), transparent 70%);
    bottom: -10%;
    right: -10%;
    animation: floatBlob2 30s ease-in-out infinite;
}

@keyframes floatBlob1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(80px, 60px) scale(1.1);
    }

    66% {
        transform: translate(-40px, 30px) scale(0.95);
    }
}

@keyframes floatBlob2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-60px, -40px) scale(1.08);
    }

    66% {
        transform: translate(50px, -20px) scale(0.9);
    }
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    height: 64px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: var(--glass);
    -webkit-backdrop-filter: var(--glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand a {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    margin-left: 2rem;
    flex: 1;
}

.nav-links a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--secondary);
    box-shadow: 0 0 15px var(--primary-glow-lg);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary);
}

.nav-links a.nav-admin {
    color: var(--warning);
}

.nav-links a.nav-admin:hover,
.nav-links a.nav-admin.active {
    background: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-logout {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-logout-mobile {
    display: none;
}

/* ─── Container ──────────────────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* ─── Flash Messages ─────────────────────────────────────────────────── */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    backdrop-filter: blur(12px);
}

.flash-success {
    background: rgba(0, 229, 160, 0.1);
    border: 1px solid rgba(0, 229, 160, 0.25);
    color: var(--success);
    box-shadow: 0 0 20px rgba(0, 229, 160, 0.08);
}

.flash-error {
    background: rgba(255, 77, 106, 0.1);
    border: 1px solid rgba(255, 77, 106, 0.25);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(255, 77, 106, 0.08);
}

.flash-warning {
    background: rgba(255, 190, 46, 0.1);
    border: 1px solid rgba(255, 190, 46, 0.25);
    color: var(--warning);
    box-shadow: 0 0 20px rgba(255, 190, 46, 0.08);
}

.flash-info {
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid rgba(124, 92, 252, 0.25);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(124, 92, 252, 0.08);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Page Header ────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 0 30px var(--primary-glow-lg);
}

.balance-badge {
    background: linear-gradient(135deg, var(--primary), #a855f7, var(--accent2));
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 2px 20px var(--primary-glow), 0 0 40px rgba(168, 85, 247, 0.15);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 2px 20px var(--primary-glow), 0 0 40px rgba(168, 85, 247, 0.15);
    }

    50% {
        box-shadow: 0 2px 25px var(--primary-glow), 0 0 60px rgba(168, 85, 247, 0.25);
    }
}

.balance-large {
    font-size: 1.5rem;
    padding: 0.75rem 2rem;
}

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-glow);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ─── Stats ──────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 30px var(--primary-glow-lg), 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.highlight {
    border-color: rgba(255, 190, 46, 0.3);
    box-shadow: 0 0 20px rgba(255, 190, 46, 0.1);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    background: linear-gradient(135deg, var(--text), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Products Grid ──────────────────────────────────────────────────── */
.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    text-shadow: 0 0 20px var(--primary-glow-lg);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, var(--primary) 50%, var(--accent) 60%, transparent 70%);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover {
    border-color: transparent;
    box-shadow: 0 8px 40px var(--primary-glow-lg), 0 0 60px rgba(0, 229, 255, 0.05);
    transform: translateY(-4px);
}

.product-card:hover::before {
    opacity: 1;
    animation: borderShimmer 3s linear infinite;
}

@keyframes borderShimmer {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.product-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.05), transparent);
}

.product-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.product-body {
    padding: 1rem;
}

.duration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}

.duration-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.duration-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--primary-glow), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition);
}

.duration-btn:hover {
    background: linear-gradient(135deg, var(--primary), #9478ff);
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow), 0 0 40px rgba(124, 92, 252, 0.15);
    transform: scale(1.03);
}

.duration-btn:hover::after {
    opacity: 1;
}

.dur-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.duration-btn:hover .dur-label {
    color: var(--text);
}

.dur-price {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.dur-stock {
    font-size: 0.7rem;
    color: var(--success);
    margin-top: 0.15rem;
}

.duration-btn.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
}

.duration-btn.out-of-stock .dur-stock {
    color: var(--danger);
}

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), 0 0 80px var(--primary-glow-lg);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.purchase-summary {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.summary-total {
    font-size: 1.1rem;
    font-weight: 700;
    border-top: 2px solid var(--primary);
    border-bottom: none;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.qty-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.qty-selector input {
    width: 60px;
    text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 0.9rem;
    height: 32px;
}

.qty-presets {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin: 0.75rem 0;
}

.preset-btn {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.preset-btn:hover {
    background: var(--secondary);
    color: var(--text);
    border-color: var(--primary);
}

.bonus-info {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--success);
    text-align: center;
    margin-top: 0.75rem;
}

/* ─── Success Page ───────────────────────────────────────────────────── */
.success-page {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.success-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg), 0 0 80px var(--success-glow);
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 20px var(--success-glow));
}

.success-card h2 {
    margin-bottom: 1.5rem;
    color: var(--success);
    text-shadow: 0 0 20px var(--success-glow);
}

.purchase-details,
.detail-row {
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.detail-row.bonus {
    color: var(--success);
}

.price-tag {
    font-weight: 700;
    color: var(--primary);
}

.keys-section {
    margin-top: 1.5rem;
    text-align: left;
}

.keys-section h3 {
    margin-bottom: 0.75rem;
}

.keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.key-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.key-item:hover {
    border-color: var(--border-light);
    box-shadow: 0 0 15px var(--primary-glow-lg);
}

.key-item.key-bonus {
    border-color: rgba(0, 229, 160, 0.3);
    box-shadow: 0 0 15px var(--success-glow);
}

.key-value {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.btn-copy {
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--secondary);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.success-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* ─── Badges ─────────────────────────────────────────────────────────── */
.badge {
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-bonus {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-finished,
.status-confirmed {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
}

.status-waiting,
.status-pending {
    background: rgba(243, 156, 18, 0.15);
    color: var(--warning);
}

.status-failed,
.status-expired {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
}

.role-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: rgba(243, 156, 18, 0.2);
    color: var(--warning);
}

.role-seller {
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary);
}

.role-customer {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* ─── Tables ─────────────────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.row-pending {
    background: rgba(243, 156, 18, 0.05);
}

.key-inline {
    font-family: 'SF Mono', monospace;
    font-size: 0.8rem;
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.actions-cell {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

.text-danger {
    color: var(--danger);
    font-weight: 600;
}

.text-warning {
    color: var(--warning);
    font-weight: 600;
}

.text-success {
    color: var(--success);
    font-weight: 600;
}

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), 0 0 20px rgba(124, 92, 252, 0.1);
}

.form-select-sm {
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 0.8rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-file {
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.inline-forms {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form input {
    width: 140px;
}

.amount-presets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    gap: 0.35rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9478ff);
    color: white;
    box-shadow: 0 2px 15px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #a78bfa);
    box-shadow: 0 4px 25px var(--primary-glow), 0 0 50px rgba(124, 92, 252, 0.15);
    transform: translateY(-2px);
    color: white;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text);
    color: var(--text);
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

/* ─── Auth Pages ─────────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg), 0 0 100px var(--primary-glow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent2));
    box-shadow: 0 0 20px var(--primary-glow);
}

.auth-logo {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}

.auth-card h2 {
    text-align: center;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Admin Nav Grid ─────────────────────────────────────────────────── */
.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.admin-nav-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.35s ease;
}

.admin-nav-card:hover {
    border-color: var(--border-glow);
    background: var(--bg-card-hover);
    box-shadow: 0 8px 30px var(--primary-glow-lg), 0 0 50px rgba(0, 229, 255, 0.05);
    transform: translateY(-4px);
    color: var(--text);
}

.admin-nav-card:hover::before {
    transform: scaleX(1);
}

.admin-nav-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ─── Filter Bar ─────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.period-filters {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), #9478ff);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 15px var(--primary-glow);
}

/* ─── Product Stats ──────────────────────────────────────────────────── */
.product-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.product-stat-name {
    color: var(--text);
}

.product-stat-count {
    color: var(--primary);
    font-weight: 600;
}

/* ─── Files Grid ─────────────────────────────────────────────────────── */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    backdrop-filter: blur(12px);
}

.file-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 4px 25px var(--primary-glow-lg);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.file-info {
    flex: 1;
}

.file-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
}

.file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ─── Wallet Grid ────────────────────────────────────────────────────── */
.wallet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
}

/* ─── Empty State ────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.footer p {
    background: linear-gradient(90deg, var(--text-dim), var(--text-muted), var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-nav);
        flex-direction: column;
        padding: 0.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        backdrop-filter: var(--glass);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .nav-right {
        display: none;
    }

    .nav-logout-mobile {
        display: block;
        color: var(--danger);
        font-weight: 600;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .wallet-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .success-actions {
        flex-direction: column;
    }

    .inline-forms {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Custom Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 252, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 92, 252, 0.5);
}

/* ─── Selection ──────────────────────────────────────────────────────── */
::selection {
    background: rgba(124, 92, 252, 0.35);
    color: #fff;
}

/* ─── Card h3 glow ───────────────────────────────────────────────────── */
.card h3 {
    position: relative;
    display: inline-block;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary);
}

/* ─── Table row highlight ────────────────────────────────────────────── */
.data-table tr:hover td {
    background: rgba(124, 92, 252, 0.04);
}

/* ─── Navbar z-index fix ─────────────────────────────────────────────── */
.navbar {
    z-index: 100;
    position: sticky;
}