:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    --transition: all 0.2s ease;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: #1e293b;
    --bg-body: #0b0f19;
    --bg-surface: #111827;
    --text-main: #f3f4f6;
    --text-muted: #94a3b8;
    --border: #1f2937;
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background: var(--bg-body); 
    color: var(--text-main); 
    height: 100vh; 
    overflow: hidden; 
}

.app-container { 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

/* ডেস্কটপ সাইডবার */
.sidebar { 
    width: 260px; 
    background: var(--bg-surface); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    z-index: 100; 
}

.sidebar-brand { 
    padding: 22px 20px; 
    font-size: 20px; 
    font-weight: 800; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    border-bottom: 1px solid var(--border); 
}

.nav-item { 
    padding: 12px 20px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    cursor: pointer; 
    color: var(--text-muted); 
    font-weight: 600; 
    transition: var(--transition); 
}

.nav-item.active, 
.nav-item:hover { 
    background: var(--primary-light); 
    color: var(--primary); 
}

/* ওয়ার্কস্পেস */
.main-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 25px; 
    position: relative; 
}

.top-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.card { 
    background: var(--bg-surface); 
    border: 1px solid var(--border); 
    border-radius: 14px; 
    padding: 18px; 
    margin-bottom: 18px; 
    box-shadow: var(--shadow); 
}

.grid-3 { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 16px; 
    margin-bottom: 20px; 
}

.btn { 
    padding: 10px 16px; 
    border-radius: 10px; 
    border: none; 
    font-weight: 700; 
    cursor: pointer; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    transition: var(--transition); 
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { transform: scale(0.98); }
.btn-success { background: var(--success); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }

.form-input, .form-select, .form-textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    background: var(--bg-surface); 
    color: var(--text-main); 
    margin: 6px 0 14px; 
    outline: none; 
    font-size: 14px; 
}

.form-input:focus, .form-select:focus { 
    border-color: var(--primary); 
}

.panel { display: none; }
.panel.active { 
    display: block; 
    animation: fadeIn 0.2s ease; 
}

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

/* মোবাইল বটম নেভিগেশন বার */
.bottom-nav { 
    display: none; 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: var(--bg-surface); 
    border-top: 1px solid var(--border); 
    z-index: 999; 
    justify-content: space-around; 
    align-items: center; 
    padding: 8px 10px; 
    padding-bottom: max(8px, env(safe-area-inset-bottom)); 
}

.bn-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 3px; 
    color: var(--text-muted); 
    font-size: 11px; 
    font-weight: 700; 
    cursor: pointer; 
    flex: 1; 
}

.bn-item i { font-size: 20px; transition: var(--transition); }
.bn-item.active { color: var(--primary); }
.bn-item.active i { 
    background: var(--primary-light); 
    padding: 4px 14px; 
    border-radius: 16px; 
}

/* কোড এডিটর মোডাল */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.7); 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999; 
    padding: 15px; 
}

.modal-overlay.active { display: flex; }
.CodeMirror { height: 360px; border-radius: 10px; font-size: 13.5px; }

/* মোবাইল অপটিমাইজেশন */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav { display: flex; }
    .main-content { padding: 15px; padding-bottom: 75px; }
    .top-header h2 { font-size: 17px; }
    .grid-3 { grid-template-columns: 1fr; gap: 12px; }
    .card { padding: 15px; }
    .CodeMirror { height: 300px; }
}
