* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0e0e0e;
    --bg-sidebar: #141414;
    --bg-card: rgba(35, 35, 35, 0.85);
    --bg-card-hover: rgba(45, 45, 45, 0.95);
    --bg-input: #1a1a1a;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --accent-light: #ff6b5b;
    --green: #2ecc71;
    --yellow: #f1c40f;
    --red: #e74c3c;
    --text: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 8px;
    --radius-sm: 6px;
    --sidebar-w: 240px;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--text); text-decoration: none; transition: all 0.15s; }

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    justify-content: space-between;
    z-index: 100;
    overflow-y: auto;
    padding: 20px 14px;
}
.sidebar-top { display: flex; flex-direction: column; gap: 6px; }
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; margin-bottom: 20px;
    text-decoration: none;
}
.logo-img {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800; color: white;
}
.logo-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.2; }
.logo-text strong { color: var(--text); font-size: 0.85rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
    text-decoration: none;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-link.active { background: rgba(255,255,255,0.08); color: var(--text); }
.sidebar-link svg { opacity: 0.6; flex-shrink: 0; }
.sidebar-link:hover svg, .sidebar-link.active svg { opacity: 1; }
.sidebar-link-muted { color: var(--text-muted); font-size: 0.8rem; }
.sidebar-link-muted:hover { color: var(--red); }
.sidebar-link-accent { color: var(--accent-light); }
.sidebar-link-accent:hover { background: rgba(231,76,60,0.1); color: var(--accent-light); }
.sidebar-link-download { color: var(--green); }
.sidebar-link-download:hover { background: rgba(46,204,113,0.1); color: var(--green); }
.sidebar-link-download svg { opacity: 0.8; }
.user-avatar {
    width: 26px; height: 26px; border-radius: 6px;
    background: var(--accent); display: flex; align-items: center;
    justify-content: center; font-size: 0.7rem; font-weight: 700;
    color: white; flex-shrink: 0;
}
.sidebar-bottom {
    display: flex; flex-direction: column; gap: 2px;
    padding-top: 16px; border-top: 1px solid var(--border);
}
.sidebar-balance {
    display: flex; align-items: baseline; gap: 5px;
    padding: 10px 12px; margin-bottom: 4px;
}
.balance-value { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.balance-currency { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }

/* ========== MOBILE TOPBAR ========== */
.mobile-topbar {
    display: none; position: fixed; top: 0; left: 0; right: 0; height: 56px;
    background: var(--bg-sidebar); border-bottom: 1px solid var(--border);
    padding: 0 16px; align-items: center; justify-content: space-between;
    z-index: 99;
}
.mobile-logo { font-size: 0.95rem; color: var(--text-secondary); }
.mobile-logo strong { color: var(--text); }
.mobile-toggle { background: none; border: none; cursor: pointer; padding: 6px; }
.mobile-toggle span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 99;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 40px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.85rem; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.9rem; }
.btn-block { width: 100%; }

/* ========== HERO ========== */
.hero {
    text-align: center; padding: 80px 20px 50px;
    position: relative;
}
.hero-bg { display: none; }
.hero-content { max-width: 600px; margin: 0 auto; }
.hero-title { font-size: 2.8rem; font-weight: 800; line-height: 1.1; margin-bottom: 12px; letter-spacing: -1px; }
.hero-subtitle { font-size: 1.05rem; color: var(--accent-light); font-weight: 500; margin-bottom: 8px; }
.hero-desc { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 26px; line-height: 1.6; }
.hero-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.hero-ip { display: flex; align-items: center; gap: 10px; justify-content: center; }
.hero-ip span { color: var(--text-secondary); font-size: 0.82rem; }
.server-ip {
    background: var(--bg-card); padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; color: var(--text);
    border: 1px solid var(--border); cursor: pointer;
    font-family: 'Courier New', monospace;
}
.server-ip:hover { border-color: var(--border-hover); }
.server-ip.copied { border-color: var(--green); color: var(--green); }

/* ========== FEATURES ========== */
.features { padding: 40px 0; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; text-align: center;
    transition: all 0.15s;
}
.feature-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.feature-icon { font-size: 1.8rem; margin-bottom: 10px; }
.feature-card h3 { font-size: 0.9rem; margin-bottom: 5px; font-weight: 600; }
.feature-card p { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }

/* ========== PAGE HEADER ========== */
.page-header {
    padding: 10px 0 24px;
}
.page-header .container { padding: 0; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 0.88rem; }

/* ========== SECTION TITLES ========== */
.section-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 28px; }
.preview-section { padding: 30px 0 40px; }

/* ========== ITEMS GRID ========== */
.container { max-width: 100%; padding: 0; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.item-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    transition: all 0.15s;
}
.item-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.item-image {
    height: 90px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
}
.item-image img { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(255,255,255,0.1)); }
.item-placeholder { font-size: 1.8rem; font-weight: 800; color: var(--text-muted); opacity: 0.4; }
.item-info { flex: 1; }
.item-info h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 3px; }
.item-info p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.4; margin-bottom: 5px; }
.item-price { font-size: 0.95rem; font-weight: 700; color: var(--accent-light); }

/* ========== SHOP ========== */
.shop-section { padding: 0; }
.category-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-btn {
    padding: 7px 16px; border-radius: 4px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 0.82rem; font-weight: 500;
    transition: all 0.15s; text-decoration: none;
}
.cat-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: white; }
.balance-bar {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 18px; font-size: 0.88rem;
}
.item-actions { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.qty-selector { display: flex; align-items: center; }
.qty-btn {
    width: 28px; height: 28px; border: 1px solid var(--border);
    background: rgba(255,255,255,0.04); color: var(--text); font-size: 0.85rem;
    cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center;
}
.qty-btn:first-child { border-radius: 4px 0 0 4px; }
.qty-btn:last-child { border-radius: 0 4px 4px 0; }
.qty-btn:hover { background: rgba(255,255,255,0.1); }
.qty-input {
    width: 38px; height: 28px; text-align: center;
    background: var(--bg-input); border: 1px solid var(--border); border-left: none; border-right: none;
    color: var(--text); font-family: inherit; font-size: 0.78rem;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ========== AUTH ========== */
.auth-section {
    display: flex; align-items: center; justify-content: center;
    min-height: calc(100vh - 80px); padding: 20px;
}
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    width: 100%; max-width: 400px;
}
.auth-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.auth-card > p { color: var(--text-secondary); margin-bottom: 20px; font-size: 0.83rem; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }
.form-group input {
    padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--bg-input); border: 1px solid var(--border);
    color: var(--text); font-family: inherit; font-size: 0.85rem;
}
.form-group input:focus { outline: none; border-color: rgba(255,255,255,0.2); }
.form-group small { font-size: 0.7rem; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-link { text-align: center; margin-top: 12px; font-size: 0.78rem; color: var(--text-secondary); }
.auth-link a { color: var(--accent-light); }

/* ========== ALERTS ========== */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.83rem; margin-bottom: 14px; }
.alert-error { background: rgba(231,76,60,0.1); border: 1px solid rgba(231,76,60,0.2); color: #ff8a80; }
.alert-success { background: rgba(46,204,113,0.1); border: 1px solid rgba(46,204,113,0.2); color: #69f0ae; }

/* ========== RECHARGE ========== */
.recharge-section { padding: 0; }
.balance-display {
    text-align: center; margin-bottom: 28px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px;
}
.balance-label { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 5px; }
.balance-amount { font-size: 2rem; font-weight: 800; color: var(--text); }
.recharge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 28px; }
.recharge-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; text-align: center;
    transition: all 0.15s; position: relative;
}
.recharge-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.recharge-card.popular { border-color: var(--accent); }
.recharge-badge {
    position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
    background: var(--accent); padding: 2px 10px; border-radius: 3px;
    font-size: 0.68rem; font-weight: 600; color: white; white-space: nowrap;
}
.recharge-amount { font-size: 1.2rem; font-weight: 700; margin-bottom: 4px; }
.recharge-price { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.dedipass-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; text-align: center;
}
.dedipass-container h3 { margin-bottom: 5px; font-size: 1rem; }
.dedipass-container p { color: var(--text-secondary); font-size: 0.83rem; margin-bottom: 14px; }

/* ========== PROFIL ========== */
.profil-section { padding: 0; }
.profil-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.profil-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px; text-align: center;
}
.profil-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; margin: 0 auto 12px; color: white;
}
.profil-card h2 { font-size: 1.1rem; margin-bottom: 2px; }
.profil-email { color: var(--text-secondary); font-size: 0.78rem; margin-bottom: 16px; }
.profil-balance { background: var(--bg-input); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.profil-info { margin-top: 12px; font-size: 0.72rem; color: var(--text-muted); }
.profil-history { min-width: 0; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab {
    padding: 8px 16px; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-family: inherit; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.tab:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.tab.active { background: var(--accent); border-color: var(--accent); color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========== TABLE ========== */
.history-table {
    width: 100%; border-collapse: collapse;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.history-table th {
    text-align: left; padding: 10px 12px; font-size: 0.72rem;
    color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.history-table td { padding: 10px 12px; font-size: 0.8rem; border-bottom: 1px solid var(--border); }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover { background: rgba(255,255,255,0.02); }
.status-badge { padding: 2px 8px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }
.status-sent { background: rgba(46,204,113,0.1); color: var(--green); }
.status-pending { background: rgba(241,196,15,0.1); color: var(--yellow); }
.status-failed { background: rgba(231,76,60,0.1); color: var(--red); }
.type-badge { font-weight: 700; }
td.credit { color: var(--green); }
td.debit { color: var(--red); }

/* ========== EMPTY ========== */
.empty-state { text-align: center; padding: 28px; color: var(--text-secondary); font-size: 0.83rem; }

/* ========== NOTIFICATION ========== */
.notification {
    position: fixed; bottom: 20px; right: 20px; z-index: 200;
    padding: 12px 18px; border-radius: var(--radius-sm);
    font-size: 0.83rem; font-weight: 500;
    animation: slideIn 0.3s ease; max-width: 360px;
}
.notification.hidden { display: none; }
.notification.success { background: var(--green); color: white; }
.notification.error { background: var(--red); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== MOBILE ========== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; z-index: 101; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .mobile-topbar + .sidebar-overlay { display: block; }
    .mobile-topbar { display: flex; }
    .main-content { margin-left: 0; padding: 72px 16px 30px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .profil-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .items-grid { grid-template-columns: 1fr 1fr; }
    .balance-bar { flex-direction: column; gap: 8px; text-align: center; }
    .hero-title { font-size: 1.8rem; }
    .hero { padding: 40px 10px 30px; }
}
@media (max-width: 480px) {
    .items-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
}
