:root {
    --bg: #0b0d0f;
    --panel: #111418;
    --card: #14171c;
    --accent: #1b77ff;
    --text: #ffffff;
    --muted: #6c727f;
    --border: #1f242d;
    --danger: #ff4d4d;
    --success: #2ecc71;
    --radius: 12px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow-x: hidden;
}

.page { 
    display: grid; 
    grid-template-columns: 260px 1fr; 
    min-height: 100vh; 
}

/* Sidebar - FIXED/STATIC */
.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; margin-bottom: 32px; padding: 0 8px; }
.logo-mark { color: var(--accent); font-size: 24px; }

.menu { display: grid; gap: 6px; }
.menu-item {
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}
.menu-item i { width: 20px; text-align: center; }
.menu-item:hover { background: rgba(255,255,255,0.03); color: var(--text); }
.menu-item.active { background: rgba(27, 119, 255, 0.1); color: var(--accent); border: 1px solid rgba(27, 119, 255, 0.2); }

.sidebar-footer { margin-top: auto; padding: 12px; border-radius: var(--radius); background: rgba(255,255,255,0.02); display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sidebar-footer i { color: var(--accent); }

/* Main Content */
.content { 
    padding: 0; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
    overflow-y: auto;
}

.top-header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top-header .burger { font-size: 20px; cursor: pointer; }

/* Profile Banner Area */
.profile-banner-section {
    position: relative;
    padding-bottom: 24px;
}
.banner-bg {
    height: 160px;
    background: linear-gradient(180deg, #181c22 0%, #0b0d0f 100%);
}
.profile-main-info {
    margin-top: -60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.profile-main-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--bg);
    background: var(--card);
    overflow: hidden;
    margin-bottom: 12px;
}
.profile-main-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-main-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-main-status { font-size: 13px; color: #fff; background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 20px; margin-bottom: 16px; }

/* Tabs & Socials row */
.profile-sub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    margin-bottom: 24px;
}
.tabs { display: flex; gap: 24px; }
.tab-link { color: var(--muted); text-decoration: none; font-size: 14px; padding-bottom: 8px; border-bottom: 2px solid transparent; transition: 0.2s; }
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--accent); border-bottom-color: var(--accent); }

.social-btns { display: flex; gap: 8px; }
.social-btn {
    background: rgba(27, 119, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(27, 119, 255, 0.2);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}

/* Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 20px;
    padding: 0 40px 40px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.info-item { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.info-icon { width: 20px; color: var(--accent); text-align: center; }
.info-label { color: var(--muted); flex: 1; }
.info-value { font-weight: 500; }

/* Timeline / Actions */
.timeline { display: grid; gap: 16px; }
.timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.timeline-dot { width: 8px; height: 8px; background: var(--muted); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.timeline-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.timeline-content { flex: 1; }
.timeline-text { font-size: 14px; margin-bottom: 4px; line-height: 1.4; }
.timeline-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; }

/* Forms & Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: rgba(255, 77, 77, 0.1); color: var(--danger); border: 1px solid rgba(255, 77, 77, 0.2); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text); }

.input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
.input-wrapper { position: relative; width: 100%; }
.clear-btn { 
    position: absolute; 
    right: 12px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--muted); 
    cursor: pointer; 
    z-index: 10;
    transition: color 0.2s;
}
.clear-btn:hover { color: #fff; }

.qr-container { text-align: center; margin-bottom: 16px; }
.qr-container img { border-radius: 12px; border: 4px solid #fff; }

.flash-msg {
    margin: 20px 40px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
}
.flash-success { background: rgba(46, 204, 113, 0.1); color: var(--success); border: 1px solid rgba(46, 204, 113, 0.2); }
.flash-error { background: rgba(255, 77, 77, 0.1); color: var(--danger); border: 1px solid rgba(255, 77, 77, 0.2); }

/* Global Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.content { padding: 0; display: flex; flex-direction: column; animation: fadeInUp 0.4s ease-out; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; animation: scaleIn 0.3s ease-out; }
.main-grid > div { animation: fadeInUp 0.4s ease-out; }

/* Avatar Editor Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: none;
    place-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}
.modal-overlay.active { display: grid; }
.avatar-modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 460px;
    padding: 24px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: scaleIn 0.2s ease-out;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
}
.croppie-container { height: 320px; margin-bottom: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* User List Table */
.user-row { cursor: pointer; transition: background 0.15s; }
.user-row:hover { background: rgba(255,255,255,0.03) !important; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: grid;
    gap: 12px;
}
.toast {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease-out forwards;
    border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast i { font-size: 18px; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

/* Developer Name Animation */
@keyframes goldGradient {
    from { background-position: 0% 0%; }
    to { background-position: -200% 0%; }
}
.dev-name {
    background: linear-gradient(135deg, #ffcc33, #ff6600, #ffcc33, #ff6600, #ffcc33);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    animation: goldGradient 4s linear infinite;
    display: inline-block;
}

/* Shinoa KV table + inventory grids */
.kv-table { width: 100%; }
.kv-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.kv-k { color: rgba(255,255,255,0.75); font-weight: 600; }
.kv-v { color: rgba(255,255,255,0.95); font-weight: 600; }

.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.inv-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}
.inv-slot { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.inv-img { height: 74px; display: grid; place-items: center; margin-bottom: 8px; }
.inv-img img { max-height: 74px; max-width: 100%; }
.inv-qty { font-size: 13px; margin-bottom: 8px; color: rgba(255,255,255,0.75); }
.inv-name { font-size: 12px; color: rgba(255,255,255,0.85); }

@media (max-width: 1000px) {
    .page { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-grid { grid-template-columns: 1fr; }
}
